Commit ceabe65d authored by Sean Madsen's avatar Sean Madsen

Copy internal redirects file when publishing

parent 9a8d18b5
......@@ -407,6 +407,21 @@ class Publisher {
return TRUE;
}
/**
* If we have an internal redirects file in the repo, then copy it to the
* path where the book is published. This app will look for redirects in this
* file when it can't find static HTML files to serve.
*
* @return bool
*/
private function setupRedirects() {
$redirectsFile = $this->repoPath . '/redirects/internal.txt';
if (file_exists($redirectsFile)) {
copy($redirectsFile, $this->publishPath . '/redirects.txt');
}
return TRUE;
}
/**
* Publish a book, or multiple books, based on a flexible identifier
*
......@@ -512,7 +527,8 @@ class Publisher {
$this->gitCheckout() &&
$this->gitPull() &&
$this->build() &&
$this->setupSymlinks();
$this->setupSymlinks() &&
$this->setupRedirects();
return $success;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment