mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 09:37:26 +00:00
link to edit help articles on github
This commit is contained in:
parent
d6543a05fa
commit
84a5a14ad4
3 changed files with 14 additions and 4 deletions
|
@ -17,7 +17,8 @@ class NavActions extends Actions
|
|||
public static function prepareFooterPartial(array $vars)
|
||||
{
|
||||
return $vars + [
|
||||
'showLearnFooter' => false
|
||||
'isDark' => false,
|
||||
'showLearnFooter' => false,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -11,6 +11,9 @@
|
|||
</div>
|
||||
<h1><?php echo htmlentities($post->getTitle()) ?></h1>
|
||||
<?php echo $post->getContentHtml() ?>
|
||||
<p class="meta">
|
||||
See a mistake? <a href="<?php echo $post->getGithubEditUrl() ?>">Edit this page on GitHub</a>.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
|
Loading…
Add table
Reference in a new issue