新杰基尔网页未链接到样式表
问题描述:
我已经创建了一个新的哲基尔页面,包括顶部的相应YAML前页信息。我的问题是,页面呈现没有任何样式。经过检查,我看到头标签是空的,所以CSS没有链接。我确信我错过了一些显而易见的东西,但我很难过。我发现样式表链接到索引页面,而不是我的新页面,我不知道我缺少什么来包含链接到我的样式表的头部数据。以下是我在新页面中的内容。新杰基尔网页未链接到样式表
---
layout: default
title: New Site
---
<div>
<div>
<h2>
<a href="test.html">Our Sweet Test Page</a>
</h2>
<section>
<article class="dope-page">
<h1>Test Headline</h1>
</article>
</section>
</div>
</div>
答
以我的观点来看,Jekyll使用layout
参数将页面与index.html
并排显示,并找到_layouts
文件夹中的布局。在你的情况下,你使用layout: default
,所以你应该检查_layouts/default.html
文件。
的default.html
文件由jekyll new your_awesome_site
产生的应如下:
<!DOCTYPE html>
<html>
{% include head.html %}
<body>
{% include header.html %}
<div class="page-content">
<div class="wrapper">
{{ content }}
</div>
</div>
{% include footer.html %}
</body>
</html>
而且css文件是_includes/head.html
。
你在哪里放新页面? – iplus26
它位于index.html旁边的根目录中。那是对的吗? – Jef