From 8fa32b8c7732f46852146152cd30295a16fd25ee Mon Sep 17 00:00:00 2001 From: tobiju Date: Fri, 28 Jul 2017 20:10:21 +0200 Subject: [PATCH] Add core template --- templates/core.php | 6 ++++++ templates/main.php | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 templates/core.php diff --git a/templates/core.php b/templates/core.php new file mode 100644 index 0000000..7a72ac5 --- /dev/null +++ b/templates/core.php @@ -0,0 +1,6 @@ +render('navheader'); +echo $this->page->isIndex() ? $this->render('toc') : ''; +echo $this->html; +echo $this->render('navfooter'); +?> diff --git a/templates/main.php b/templates/main.php index 97b51e8..ea67184 100644 --- a/templates/main.php +++ b/templates/main.php @@ -12,9 +12,6 @@ // this file multiple times. include_once __DIR__ . '/helper.php'; -// default library templates -$library = (getenv('VENDOR_PATH') ?: dirname(dirname(dirname(__DIR__))).'/') . "bookdown/bookdown/templates"; - // project-specific templates $templatePath = __DIR__; @@ -27,7 +24,7 @@ $templates->set("body", "{$templatePath}/body.php"); $templates->set("script", "{$templatePath}/script.php"); $templates->set("nav", "{$templatePath}/nav.php"); -$templates->set("core", "{$library}/core.php"); +$templates->set("core", "{$templatePath}/core.php"); $templates->set("navheader", "{$templatePath}/navheader.php"); $templates->set("navfooter", "{$templatePath}/navfooter.php"); $templates->set("toc", "{$templatePath}/toc.php");