让我们假设我们在domain.com/rendered-post/上有一个渲染的Jekyll帖子。
这篇文章的源码在https://github.com/username/username.github.io/blob/master/_posts/2013-12-10-rendered-post-title.md。
当post呈现时,是否可以自动将源代码页面的链接包含到post中?
post中的最终结果应该是<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>。
发布于 2013-12-10 23:25:43
我在布局中使用页面变量{{ 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>https://stackoverflow.com/questions/20493397
复制相似问题