如何将生成的 link 转换为 GitHub 页面上 post 的原始降价文件?

How can I make a generated link to a post's original markdown file on GitHub Pages?

我正在使用 GitHub 个页面生成 my blog。我想在每个 post 上放置一个 link 以允许查看者查看 MD 源和/或创建拉取请求以建议修改 post。

但是,I can't find任何描述如何生成此类 URL 的内容。

我在想这样的事情:

<a href="{{ post.original.url }}">View Original</a>

这可能吗?如果是这样,我该怎么做?

您可以直接为每个页面生成一个 link,将这样的 URL 添加到您的布局中,例如,对于用户 john 和 foo-repo:https://github.com/john/foo-repo/edit/master/{{ page.path }}

<a href="https://github.com/john/foo-repo/edit/master/{{ page.path }}" class="text-success">

         <i class="fa fa-pencil"></i> &nbsp;Improve this page

        </a>

我用过这种方法,下面是一个例子:https://github.com/marcanuy/jekyll-skeleton/blob/master/_layouts/default.html and working: https://marcanuy.github.io/jekyll-skeleton/