diff --git a/controller/action/NavActions.class.php b/controller/action/NavActions.class.php index 8f91f5d1..5ddc575a 100644 --- a/controller/action/NavActions.class.php +++ b/controller/action/NavActions.class.php @@ -17,7 +17,8 @@ class NavActions extends Actions public static function prepareFooterPartial(array $vars) { return $vars + [ - 'showLearnFooter' => false + 'isDark' => false, + 'showLearnFooter' => false, ]; } diff --git a/model/Post.class.php b/model/Post.class.php index 2f71744a..77e7e4f9 100644 --- a/model/Post.class.php +++ b/model/Post.class.php @@ -10,7 +10,7 @@ class Post SORT_ORD_ASC = 'sort_ord_asc'; protected static $slugMap = []; - protected $slug, $title, $metadata, $author, $date, $markdown, $contentText, $contentHtml, $cover, $postType, $category; + protected $path, $slug, $title, $metadata, $author, $date, $markdown, $contentText, $contentHtml, $cover, $postType, $category; protected $isCoverLight = false; public static function load($relativeOrAbsolutePath) @@ -47,11 +47,12 @@ class Post { throw new PostMalformedException('Post "' . basename($path) . '" is missing front matter or content'); } - return new static($postType, $slug, Spyc::YAMLLoadString(trim($frontMatter)), trim($content)); + return new static($path, $postType, $slug, Spyc::YAMLLoadString(trim($frontMatter)), trim($content)); } - public function __construct($postType, $slug, $frontMatter, $markdown) + public function __construct($path, $postType, $slug, $frontMatter, $markdown) { + $this->path = $path; $this->postType = $postType; $this->slug = $slug; $this->markdown = $markdown; @@ -394,4 +395,9 @@ class Post } return static::$slugMap[$postType]; } + + public function getGithubEditUrl() + { + return 'https://github.com/lbryio/lbry.io/tree/master' . str_replace(ROOT_DIR, '', $this->path); + } } \ No newline at end of file diff --git a/view/template/content/faq-post.php b/view/template/content/faq-post.php index 00cd860d..2fda8fb5 100644 --- a/view/template/content/faq-post.php +++ b/view/template/content/faq-post.php @@ -11,6 +11,9 @@