2013-12-10 86 views
1

让我们假设我们在domain.com/rendered-post/处呈现Jekyll帖子。将呈现的Jekyll页面显示为页面上的链接

帖子的来源驻留在https://github.com/username/username.github.io/blob/master/_posts/2013-12-10-rendered-post-title.md

是否可以在呈现时自动将源代码页的链接包含到帖子中?

该帖子的最终结果应该是<a href='https://github.com/username/username.github.io/blob/master/_posts/2013-12-10-rendered-post-title.md'>View source code of this page</a>

回答

0

我在我的布局中找到了使用页面变量{{ page.path }}的解决方案。

<a href="https://github.com/username/username.github.io/blob/master/{{ page.path }}">View source code of this page</a> 

呈现

<a href='https://github.com/username/username.github.io/blob/master/_posts/2013-12-10-rendered-post-title.md'>View source code of this page</a> 
相关问题