Skip to content

Commit

Permalink
v0.8
Browse files Browse the repository at this point in the history
Added ability to set template in content meta
  • Loading branch information
gilbitron committed Oct 23, 2013
1 parent b2fa0a4 commit aa59661
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
9 changes: 9 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
11 changes: 7 additions & 4 deletions lib/pico.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/pico_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function before_twig_register()

}

public function before_render(&$twig_vars, &$twig)
public function before_render(&$twig_vars, &$twig, &$template)
{

}
Expand Down

0 comments on commit aa59661

Please sign in to comment.