浏览代码

Merge a5e21c704c81575506deb451559ee71243a09fe2 into b2fa0a4abe1b36b27d0116b1a82c888164c6d3e1

Frank Nägler 11 年之前
父节点
当前提交
70fbd9bc16
共有 4 个文件被更改,包括 68 次插入4 次删除
  1. 1 0
      content/index.md
  2. 8 2
      lib/pico.php
  3. 48 0
      themes/default/content-sidebar.html
  4. 11 2
      themes/default/style.css

+ 1 - 0
content/index.md

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

+ 8 - 2
lib/pico.php

@@ -102,7 +102,12 @@ class Pico {
 			'is_front_page' => $url ? false : true,
 			'is_front_page' => $url ? false : true,
 		);
 		);
 		$this->run_hooks('before_render', array(&$twig_vars, &$twig));
 		$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));
 		$this->run_hooks('after_render', array(&$output));
 		echo $output;
 		echo $output;
 	}
 	}
@@ -156,7 +161,8 @@ class Pico {
 			'description' 	=> 'Description',
 			'description' 	=> 'Description',
 			'author' 		=> 'Author',
 			'author' 		=> 'Author',
 			'date' 			=> 'Date',
 			'date' 			=> 'Date',
-			'robots'     	=> 'Robots'
+			'robots'     	=> 'Robots',
+			'template'      => 'Template'
 		);
 		);
 
 
 		// Add support for custom headers by hooking into the headers array
 		// Add support for custom headers by hooking into the headers array

+ 48 - 0
themes/default/content-sidebar.html

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

+ 11 - 2
themes/default/style.css

@@ -201,8 +201,17 @@ blockquote {
 /* Structure Styles
 /* Structure Styles
 /*---------------------------------------------*/
 /*---------------------------------------------*/
 .inner {
 .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 {
 #header {