为什么我要在Jekyll bootstrap中的每个帖子中添加{%include JB/setup%}?

为什么我要在Jekyll bootstrap中的每个帖子中添加{%include JB/setup%}?,jekyll,jekyll-bootstrap,Jekyll,Jekyll Bootstrap,我正在使用。我可以发布一篇文章,但我不知道为什么发布模板会将{%include JB/setup%}放在每个发布标记文件中。我对ruby和Jekyll知之甚少。但是我检查了一些文件,我能理解一些代码。但我仍然不知道这意味着什么: {% capture jbcache %} <!-- - Dynamically set liquid variables for working with URLs/paths --> {% if site.JB.setup.provide

我正在使用。我可以发布一篇文章,但我不知道为什么发布模板会将
{%include JB/setup%}
放在每个发布标记文件中。我对ruby和Jekyll知之甚少。但是我检查了一些文件,我能理解一些代码。但我仍然不知道这意味着什么:

{% capture jbcache %}
  <!--
  - Dynamically set liquid variables for working with URLs/paths
  -->
  {% if site.JB.setup.provider == "custom" %}
    {% include custom/setup %}
  {% else %}
    {% if site.safe and site.JB.BASE_PATH and site.JB.BASE_PATH != '' %}
      {% assign BASE_PATH = site.JB.BASE_PATH %}
      {% assign HOME_PATH = site.JB.BASE_PATH %}
    {% else %}
      {% assign BASE_PATH = nil %}
      {% assign HOME_PATH = "/" %}
    {% endif %}

    {% if site.JB.ASSET_PATH %}
      {% assign ASSET_PATH = site.JB.ASSET_PATH %}
    {% else %}
      {% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ page.theme.name }}{% endcapture %}
    {% endif %}  
  {% endif %}
{% endcapture %}{% assign jbcache = nil %}
{%capture jbcache%}
{%if site.JB.setup.provider==“自定义”%}
{%include custom/setup%}
{%else%}
{%if site.safe和site.JB.BASE_路径和site.JB.BASE_路径!=''%}
{%assign BASE_PATH=site.JB.BASE_PATH%}
{%assign HOME_PATH=site.JB.BASE_PATH%}
{%else%}
{%assign BASE_PATH=nil%}
{%assign HOME_PATH=“/”%}
{%endif%}
{%if site.JB.ASSET_PATH%}
{%assign ASSET_PATH=site.JB.ASSET_PATH%}
{%else%}
{%capture ASSET_PATH%}{{BASE_PATH}}/assets/themes/{{page.theme.name}}{%endcapture%}
{%endif%}
{%endif%}
{%endcapture%}{%assign jbcache=nil%}
我查过了。我还是很困惑。这就是我的问题:

  • 为什么我要在Jekyll bootstrap中的每个帖子中添加{%include JB/setup%}
  • 我可以修改模板以删除每篇文章中的{%include JB/setup%}吗

  • 这是因为您正在使用命令
    rake post title=“new post name”

    见Rakefile:


    删除行
    post.put“{%include JB/setup%}”
    就可以了。

    这是因为JB/setup文件设置变量,如
    BASE\u PATH
    ASSET\u PATH
    ; 假设一个场景:在模板文件或html文件中,您有以下代码 然后你会出现错误。 这是因为
    ASSET_PATH
    的值不正确; 如果您像我一样使用,您将在文件“root\u directory”/\u config.yml中找到一些注释,以便更好地理解:

    # By default, the asset_path is automatically defined relative to BASE_PATH plus the enabled theme.
    # ex: [BASE_PATH]/assets/themes/[THEME-NAME]
    #
    # Override this by defining an absolute path to assets here.
    # ex:
    #   http://s3.amazonaws.com/yoursite/themes/watermelon
    #   /assets
    #
    ASSET_PATH : false  
    
    不完全是

    虽然这似乎是真的,但它从未设置,即使在基本布局中,使用资产路径或类似标记对我来说也不起作用。我建议把它拆了。加上“/”是不正确的,就像上面说的,我已经安装了窃听器更为正确,但杰基尔似乎看不到要点。(您指向的是linux驱动器的根目录,文件根本不在其中)

    谢谢你的澄清。它的存在是没有意义的,它是在主题“安装”期间添加的,这真是一种浪费

    如果您想要多个主题可用,您只需要layouts文件夹和“theme_packs”。否则,只需打开layouts文件夹。其中包括JB,正如这里所指出的,JB首先是不存在的

    您需要引导的唯一实例(这在jekyll的实现中是不正确的)是菜单

    引导 css文件 javascript文件


    与jekyll没有任何联系。你必须自己实现这一点。

    但是,如果我删除这一行。没有CSS样式和导航。@einverne:我看不出有什么问题。CSS和导航已正确呈现。例如,从您现有的任何帖子中删除
    {%include JB/setup%}
    。那么有没有办法删除这一行。@einverne:就像我说的,从Rakfile中删除
    post.put“{%include JB/setup%}”
    。对于现有的帖子,请手动完成。在我删除该行之后。我网站上的一切都出了问题。
    # By default, the asset_path is automatically defined relative to BASE_PATH plus the enabled theme.
    # ex: [BASE_PATH]/assets/themes/[THEME-NAME]
    #
    # Override this by defining an absolute path to assets here.
    # ex:
    #   http://s3.amazonaws.com/yoursite/themes/watermelon
    #   /assets
    #
    ASSET_PATH : false