From edec1cfbca717112e8d036f130b5bd197a8089c3 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 10 Mar 2018 23:41:36 +0300 Subject: [PATCH] Pages class: use constant PAGES_PATH instead of CONTENT_PATH --- rawilum/Pages.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rawilum/Pages.php b/rawilum/Pages.php index 6fdd31e5..5d213b72 100755 --- a/rawilum/Pages.php +++ b/rawilum/Pages.php @@ -46,13 +46,13 @@ class Pages if ($url) { $file = $url; } else { - $file = CONTENT_PATH . '/pages/' . $this->rawilum['config']->get('site.pages.main') . '/' . 'index.md'; + $file = PAGES_PATH . '/pages/' . $this->rawilum['config']->get('site.pages.main') . '/' . 'index.md'; } } else { if ($url) { - $file = CONTENT_PATH . '/pages/' . $url . '/index.md'; + $file = PAGES_PATH . '/pages/' . $url . '/index.md'; } else { - $file = CONTENT_PATH . '/pages/' . $this->rawilum['config']->get('site.pages.main') . '/' . 'index.md'; + $file = PAGES_PATH . '/pages/' . $this->rawilum['config']->get('site.pages.main') . '/' . 'index.md'; } } @@ -60,7 +60,7 @@ class Pages if ($this->rawilum['filesystem']->exists($file)) { $file = $file; } else { - $file = CONTENT_PATH . '/pages/404/index.md'; + $file = PAGES_PATH . '/pages/404/index.md'; Response::status(404); } @@ -97,7 +97,7 @@ class Pages $content = $page[2]; // @TODO fix this! - $url = str_replace(CONTENT_PATH . '/pages', Url::getBase(), $file); + $url = str_replace(PAGES_PATH . '/pages', Url::getBase(), $file); $url = str_replace('index.md', '', $url); $url = str_replace('.md', '', $url); $url = str_replace('\\', '/', $url); @@ -138,7 +138,7 @@ class Pages public function getPages($url = '', $raw = false, $order_by = 'date', $order_type = 'DESC', $ignore = ['404', 'index'], $limit = null) { // Get pages list for current $url - $pages_list = $this->rawilum['finder']->files()->name('*.md')->in(CONTENT_PATH . '/pages/' . $url); + $pages_list = $this->rawilum['finder']->files()->name('*.md')->in(PAGES_PATH . '/pages/' . $url); // Go trough pages list foreach ($pages_list as $key => $page) {