2013-12-10 84 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> 
相關問題