【问题标题】:How to stop style.css to be considered as the Jekyll Page?如何阻止 style.css 被视为 Jekyll 页面?
【发布时间】:2018-08-13 13:58:22
【问题描述】:

我正在使用表达式

{% assign mypages = site.pages | sort: "order" %} {% for page in 
mypages %}
{% unless page.exclude %}

<a href="{{page.url|absolute_url}}"> {{ page.shortname }} <span 
class="rate">{% include indexmod.html %}</a></span> <span class="rex"> 
| </span>
{% endunless %}
{% endfor %}

用于布局,并将不需要的 style.css 视为 Jekyll 页面

我尝试了GitHub discussion "/css/main.css considered as a Jekyll:Page? #3151" 的不同技巧,但没有帮助。有时我会删除所有样式。

请明确如何让样式正常工作,但将其排除在生成为 Jekyll 页面的链接之外。

【问题讨论】:

标签: css ruby jekyll liquid github-pages


【解决方案1】:

您应该使用site.html_pages 而不是site.pages,因为它会排除所有不使用.html 扩展名(即style.css)输出的页面。您会在此处找到两者:

https://jekyllrb.com/docs/variables/#site-variables

【讨论】:

    猜你喜欢
    • 2015-08-25
    • 1970-01-01
    • 2022-08-21
    • 2013-12-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-23
    • 1970-01-01
    相关资源
    最近更新 更多