mirror of
https://github.com/flextype/flextype.git
synced 2025-08-08 14:16:46 +02:00
Pages class: use constant PAGES_PATH instead of CONTENT_PATH
This commit is contained in:
@@ -46,13 +46,13 @@ class Pages
|
||||
if ($url) {
|
||||
$file = $url;
|
||||
} else {
|
||||
$file = PAGES_PATH . '/pages/' . $this->rawilum['config']->get('site.pages.main') . '/' . 'index.md';
|
||||
$file = PAGES_PATH . '/' . $this->rawilum['config']->get('site.pages.main') . '/' . 'index.md';
|
||||
}
|
||||
} else {
|
||||
if ($url) {
|
||||
$file = PAGES_PATH . '/pages/' . $url . '/index.md';
|
||||
$file = PAGES_PATH . '/' . $url . '/index.md';
|
||||
} else {
|
||||
$file = PAGES_PATH . '/pages/' . $this->rawilum['config']->get('site.pages.main') . '/' . 'index.md';
|
||||
$file = PAGES_PATH . '/' . $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 = PAGES_PATH . '/pages/404/index.md';
|
||||
$file = PAGES_PATH . '/404/index.md';
|
||||
Response::status(404);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class Pages
|
||||
$content = $page[2];
|
||||
|
||||
// @TODO fix this!
|
||||
$url = str_replace(PAGES_PATH . '/pages', Url::getBase(), $file);
|
||||
$url = str_replace(PAGES_PATH, 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(PAGES_PATH . '/pages/' . $url);
|
||||
$pages_list = $this->rawilum['finder']->files()->name('*.md')->in(PAGES_PATH . '/' . $url);
|
||||
|
||||
// Go trough pages list
|
||||
foreach ($pages_list as $key => $page) {
|
||||
|
Reference in New Issue
Block a user