Permalink
Browse files

v0.8

Added ability to set template in content meta
  • Loading branch information...
1 parent b2fa0a4 commit aa59661ff81dd52c3a2596988372a214b0fc31b9 @gilbitron gilbitron committed Oct 23, 2013
Showing with 17 additions and 5 deletions.
  1. +9 −0 changelog.txt
  2. +7 −4 lib/pico.php
  3. +1 −1 plugins/pico_plugin.php
View
@@ -1,5 +1,14 @@
*** Pico Changelog ***
+2013.10.23 - version 0.8
+ * [New] Added ability to set template in content meta
+ * [New] Added before_parse_content and after_parse_content hooks
+ * [Changed] content_parsed hook is now depreciated
+ * [Changed] Moved loading the config to nearer the beginning of the class
+ * [Changed] Only append ellipsis in limit_words() when word count exceeds max
+ * [Changed] Made private methods protected for better inheritance
+ * [Fixed] Fixed get_protocol() method to work in more situations
+
2013.09.04 - version 0.7
* [New] Added before_read_file_meta and get_page_data plugin hooks to customize page meta data
* [Changed] Make get_files() ignore dotfiles
View
@@ -7,7 +7,7 @@
* @author Gilbert Pellegrom
* @link http://pico.dev7studios.com
* @license http://opensource.org/licenses/MIT
- * @version 0.7
+ * @version 0.8
*/
class Pico {
@@ -101,8 +101,10 @@ public function __construct()
'next_page' => $next_page,
'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']) && $meta['template']) ? $meta['template'] : 'index';
+ $this->run_hooks('before_render', array(&$twig_vars, &$twig, &$template));
+ $output = $twig->render($template .'.html', $twig_vars);
$this->run_hooks('after_render', array(&$output));
echo $output;
}
@@ -156,7 +158,8 @@ protected function read_file_meta($content)
'description' => 'Description',
'author' => 'Author',
'date' => 'Date',
- 'robots' => 'Robots'
+ 'robots' => 'Robots',
+ 'template' => 'Template'
);
// Add support for custom headers by hooking into the headers array
@@ -79,7 +79,7 @@ public function before_twig_register()
}
- public function before_render(&$twig_vars, &$twig)
+ public function before_render(&$twig_vars, &$twig, &$template)
{
}

0 comments on commit aa59661

Please sign in to comment.