【问题标题】:{{ root_url }} in Octopress is blankOctopress 中的 {{ root_url }} 为空白
【发布时间】:2014-01-03 22:10:42
【问题描述】:

Octopress 的文档在各个方面都引用了{{ root_url }},但在我的站点中使用此值时,它似乎是空白的。

我试图通过查找它在代码中的定义位置来研究它的用途,但找不到它。

它已被弃用吗?
{{ site.root }}一样吗?

【问题讨论】:

    标签: ruby jekyll octopress


    【解决方案1】:

    是的,和{{ site.root }}基本一样。

    对我来说,它是在我的默认布局中定义的:

    {% capture root_url %}{{ site.root | strip_slash }}{% endcapture %}
    

    【讨论】:

      【解决方案2】:

      使用以下配置进行设置:

      在这里阅读它: http://octopress.org/docs/deploying/subdir/

      # Set the root project to the desired path
      rake set_root_dir[your/path]
      
      # To go back to publishing to the document root
      rake set_root_dir[/]
      

      【讨论】:

        猜你喜欢
        • 2012-09-14
        • 1970-01-01
        • 2016-05-17
        • 2015-01-04
        • 1970-01-01
        • 1970-01-01
        • 2015-09-10
        • 2021-10-25
        • 2012-09-17
        相关资源
        最近更新 更多