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 @@ + + + + + + {% if meta.title %}{{ meta.title }} | {% endif %}{{ site_title }} +{% if meta.description %} + +{% endif %}{% if meta.robots %} + +{% endif %} + + + + + + + + + + +
+
+ + {{ content }} +
+
+ + + + + \ No newline at end of file diff --git a/themes/default/style.css b/themes/default/style.css index 963bf1e..3361a03 100644 --- a/themes/default/style.css +++ b/themes/default/style.css @@ -201,8 +201,17 @@ blockquote { /* Structure Styles /*---------------------------------------------*/ .inner { - width: 850px; - margin: 0 auto; + width: 850px; + margin: 0 auto; +} + +.inner .sidebar { + width: 250px; + margin: 0 20px 20px 0; + padding: 20px; + min-height: 300px; + background: #dddddd; + float: left; } #header {