diff --git a/content/index.md b/content/index.md index 4642139..15fd435 100644 --- a/content/index.md +++ b/content/index.md @@ -1,6 +1,7 @@ /* Title: Welcome Description: This description will go in the meta description tag +Template: content-sidebar */ ## Welcome to Pico diff --git a/lib/pico.php b/lib/pico.php index dfe1f5d..2729075 100644 --- a/lib/pico.php +++ b/lib/pico.php @@ -102,7 +102,12 @@ class Pico { 'is_front_page' => $url ? false : true, ); $this->run_hooks('before_render', array(&$twig_vars, &$twig)); - $output = $twig->render('index.html', $twig_vars); + $template = (isset($meta['template']) && strlen($meta['template']) > 0) ? $meta['template'] : 'index'; + if (!file_exists(THEMES_DIR . $settings['theme'] . "/{$template}.html")) { + // fallback to index.html if template not exists... + $template = 'index'; + } + $output = $twig->render("{$template}.html", $twig_vars); $this->run_hooks('after_render', array(&$output)); echo $output; } @@ -156,7 +161,8 @@ class Pico { 'description' => 'Description', 'author' => 'Author', 'date' => 'Date', - 'robots' => 'Robots' + 'robots' => 'Robots', + 'template' => 'Template' ); // Add support for custom headers by hooking into the headers array diff --git a/themes/default/content-sidebar.html b/themes/default/content-sidebar.html new file mode 100644 index 0000000..0fe5d04 --- /dev/null +++ b/themes/default/content-sidebar.html @@ -0,0 +1,48 @@ + + +
+ + +