From 29cd5e03c5f7797ee943d2f864b23f313512bd1d Mon Sep 17 00:00:00 2001 From: Awilum Date: Wed, 14 Mar 2018 11:49:21 +0300 Subject: [PATCH] Parse shortcodes in frontmatter #7 --- rawilum/Pages.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rawilum/Pages.php b/rawilum/Pages.php index 093327c5..d2b113ea 100755 --- a/rawilum/Pages.php +++ b/rawilum/Pages.php @@ -42,8 +42,8 @@ class Pages } protected function pageShortcodes() { - // {url} - $this->rawilum['shortcodes']->add('url', function() { + // {site_url} + $this->rawilum['shortcodes']->add('site_url', function() { return Url::getBase(); }); } @@ -106,8 +106,9 @@ class Pages { $page = trim(file_get_contents($file)); $page = explode('---', $page, 3); - - $result_page = Yaml::parse($page[1]); + + $frontmatter = $this->rawilum['shortcodes']->parse($page[1]); + $result_page = Yaml::parse($frontmatter); $result_page['content'] = $page[2]; return $result_page;