【问题标题】:Internal links in Jekyll using Org modeJekyll 中使用 Org 模式的内部链接
【发布时间】:2015-08-26 20:25:39
【问题描述】:

我看到这个question 是关于使用降价链接到内部内容的。如何使用 Org 模式链接到其他帖子?

我尝试了markdown格式,我得到以下错误:

...error:
             Error: Unknown tag 'post'
             Error: Run jekyll build --trace for more information.

【问题讨论】:

    标签: emacs jekyll org-mode


    【解决方案1】:

    您可以使用{% post_url 1025-08-26-blog-post-name %}(在帖子名称后面不带.html.org)在jekyll 帖子中获取另一个博客帖子的相对URL。

    要真正使其成为链接,您需要将其包装在 html 链接中。假设您已将 org-publish 设置设置为编写 HMTL,这可能有点棘手,因为标准 org-mode 链接语法似乎不适用于 jekyll 插入的链接。相反,您可以使用 org-mode HTML 转义将锚 html 直接插入到您的 org 文件中:

    Blah blah surrounding text @@html:<a href="{% post_url 1025-08-26-blog-post-name %}">@@Text describing link to my other post@@html:</a>@@ more surrounding text

    【讨论】:

    • 太棒了! &lt;a href="{% post_url 1025-08-26-blog-post-name %}"&gt;@@Text describing link to my other post@@html:&lt;/a&gt;
    猜你喜欢
    • 2011-06-05
    • 1970-01-01
    • 2014-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多