mirror of
https://github.com/getgrav/grav.git
synced 2026-07-05 16:08:40 +02:00
Use page:// stream rather than PAGES_DIR constant
This commit is contained in:
@@ -165,7 +165,8 @@ trait MarkdownGravLinkTrait
|
||||
|
||||
// If this is a 'real' filepath clean it up
|
||||
if (file_exists($this->page->path() . '/' . parse_url($markdown_url, PHP_URL_PATH))) {
|
||||
$relative_path = rtrim($this->base_url, '/') . preg_replace('/\/([\d]+.)/', '/', str_replace(PAGES_DIR, '/', $this->page->path()));
|
||||
$pages_dir = self::$grav['locator']->findResource('page://');
|
||||
$relative_path = rtrim($this->base_url, '/') . preg_replace('/\/([\d]+.)/', '/', str_replace($pages_dir, '/', $this->page->path()));
|
||||
$markdown_url = preg_replace('/^([\d]+.)/', '', preg_replace('/\/([\d]+.)/', '/', trim(preg_replace('/[^\/]+(\.md$)/', '', $markdown_url), '/')));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user