首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将呈现的Jekyll页面的源代码显示为页面上的链接

将呈现的Jekyll页面的源代码显示为页面上的链接
EN

Stack Overflow用户
提问于 2013-12-10 19:34:03
回答 1查看 79关注 0票数 1

让我们假设我们在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>

EN

回答 1

Stack Overflow用户

发布于 2013-12-10 23:25:43

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

代码语言:javascript
复制
<a href="https://github.com/username/username.github.io/blob/master/{{ page.path }}">View source code of this page</a>

渲染

代码语言:javascript
复制
<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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20493397

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档