问题
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