【问题标题】:CSS not showing because for no apparent reason <head> is not appearing in _site folderCSS 没有显示,因为没有明显的原因 <head> 没有出现在 _site 文件夹中
【发布时间】:2018-04-23 22:16:06
【问题描述】:

我的网站做得非常好,但由于&lt;head&gt; 没有出现在_site 文件夹中,现在没有明显的原因没有显示css。同时很明显 my 在根目录中可用。

有人可以帮忙检查一下吗?因为我对明显的错误视而不见。

网站链接: http://werkbaar.net/

回购链接: https://github.com/bomengeduld/boilerplate

问题: 当我在我的网站上进行 chrome 检查时,我注意到这些标签已被剥离:

索引页结构:

<!DOCTYPE html>
<html lang="en">
    {% include head.html %}

    <!-- The #page-top ID is part of the scrolling feature - the data-spy and data-target are part of the built-in Bootstrap scrollspy function -->

    <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
        {% include nav.html %}
        {% include header.html %}

    {{ content }} 

        {% include footer.html %}
        {% include scripts.html %}
    </body>
</html>

【问题讨论】:

  • {% include head.html %} 正在从其他地方导入 head.html
  • 嗨,约翰,感谢您对此进行调查。不知道你想建议什么。一切似乎都很明显。我建议您查看我的 github 存储库以获取更多信息。 head.html 在我的 _includes 文件夹中。到目前为止,这工作顺利。为什么现在不工作了?
  • 问题不是head被隐藏了,而是head是空的...区域你确定“{% include head.html %}”指向正确的文件吗?
  • 没关系,我发现了这个错误。我忘了将 markdown YAML 添加到我的 index.html 中。出于某种原因,我在设计过程中删除了它。我很抱歉打扰。感谢您抽出宝贵时间约翰和罗伯托。
  • 提示:您可以回答自己的问题并将其标记为已解决。

标签: html css jekyll head


【解决方案1】:

通过将 YAML 前端内容添加到 index.html 来解决它,它链接到 &lt;head&gt; 所在的我的 default.html

---
layout: default
---

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-28
    • 1970-01-01
    • 2020-12-26
    • 1970-01-01
    • 2017-06-04
    • 2020-07-09
    相关资源
    最近更新 更多