有没有办法获得jekyll降价桩的完整路径? [英] Is there a way to get the full path of the markdown post in jekyll?
问题描述
我创建了一个仅供个人使用的博客.只是为了整理我自己的笔记.
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.
因此,有一种方法可以动态获取所有这些信息.或者至少是完整的markdown文件名(我可以自己对路径进行硬编码)
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)
推荐答案
{{ site.source }}
将为您提供站点根目录的绝对路径.
{{ site.source }}
will give you absolute path to your site root.
{{ page.path }}
将为您提供相对于站点根目录的页面路径.
{{ page.path }}
will give you page path relative to site root.
最后,subl {{ site.source }}/{{ page.path }}
将解决问题.
这篇关于有没有办法获得jekyll降价桩的完整路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!