首页 > 解决方案 > /_layouts/default.html 中包含一个符号链接文件或在您的 _includes 目录中不存在

问题描述

当我尝试构建我的 github.io 页面时,我收到了这个错误。

A file was included in /_layouts/default.html that is a symlink or does not exist in your _includes directory.

这个错误是什么意思?这是我的 Github 网站:https ://github.com/zechnegli/zecheng.github.io 。

谢谢!

截屏

标签: github-pages

解决方案


这意味着您有一个链接_layouts/default.html引用了一个不存在的文件。

检查_layouts/default.html

<!DOCTYPE html>
<html>
    {% include head.html %}
    <body id="page-top" class="index">
    {% include nav.html %}
    {% include header.html %}
    {% include portfolio_grid.html %}
    {% include about.html %}

    {% if site.contact == "static" %}
    {% include contact_static.html %}
    {% elsif site.contact == "disqus" %}
    {% include contact_disqus.html %}
    {% else %}
    {% include contact.html %}
    {% endif %}

    {% include footer.html %}
    {% include modals.html %}
    {% include js.html %}
    </body>
</html>

所有included文件必须在_includes目录中:

包括

如您所见,至少contact_disqus.html丢失了。


推荐阅读