Is there a way to get the full path of the markdown post in jekyll?

给你一囗甜甜゛ 提交于 2019-12-24 00:57:22

问题


I created a blog just for my personal use. Just to organize my own notes.

Unlike a proper blog where after you write the post you are usually done. I will be editing these post frequently, so in the footer I want to have the following:

sublime /path/to/_posts/markdown-post.md

So that I copy it and paste it in my terminal.

So is there a way to get all that information dynamically. Or at least the full markdown file name (I could hard code the path myself)


回答1:


{{ site.source }} will give you absolute path to your site root.

{{ page.path }} will give you page path relative to site root.

Finally subl {{ site.source }}/{{ page.path }} will do the trick.



来源:https://stackoverflow.com/questions/38406314/is-there-a-way-to-get-the-full-path-of-the-markdown-post-in-jekyll

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!