This commit is contained in:
Frank Nägler 2013-10-23 02:30:09 -07:00
commit 70fbd9bc16
4 changed files with 68 additions and 4 deletions

View file

@ -1,6 +1,7 @@
/*
Title: Welcome
Description: This description will go in the meta description tag
Template: content-sidebar
*/
## Welcome to Pico

View file

@ -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

View file

@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8" />
<title>{% if meta.title %}{{ meta.title }} | {% endif %}{{ site_title }}</title>
{% if meta.description %}
<meta name="description" content="{{ meta.description }}">
{% endif %}{% if meta.robots %}
<meta name="robots" content="{{ meta.robots }}">
{% endif %}
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,700" type="text/css" />
<link rel="stylesheet" href="{{ theme_url }}/style.css" type="text/css" />
<script src="{{ theme_url }}/scripts/modernizr-2.6.1.min.js"></script>
</head>
<body>
<header id="header">
<div class="inner clearfix">
<h1><a href="{{ base_url }}">{{ site_title }}</a></h1>
<ul class="nav">
{% for page in pages %}
<li><a href="{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
</ul>
</div>
</header>
<section id="content">
<div class="inner">
<div class="sidebar">
this is the sidebar...
</div>
{{ content }}
</div>
</section>
<footer id="footer">
<div class="inner">
<a href="http://pico.dev7studios.com">Pico</a> was made by <a href="http://gilbert.pellegrom.me">Gilbert Pellegrom</a>
from <a href="http://dev7studios.com">Dev7studios</a>.
</div>
</footer>
</body>
</html>

View file

@ -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 {