【发布时间】:2015-02-09 00:21:31
【问题描述】:
我有一个 Jekyll 站点,在根目录中有一些帖子和一些页面。
如果我导航到根目录中的页面,例如 localhost:4000/index.html _includes 目录中的所有文件使用加载没有问题:
{% include head.html %}
如果我随后使用 config.yml 中定义的永久链接格式访问帖子:
permalink: /:categories/:title
localhost:4000/blogpost/first-post
包含文件未加载。在 Firebug 中查看标头中的 CSS 文件,它会给出一个错误,即该文件未找到并且正在目录中查找:
/blogpost/first-post/css/boostrap.min.css
如果我在 YAML 中给帖子一个永久链接:
permalink: /first-post.html
一切正常。
当使用永久链接进行导航时,如何设置包含以在我的页面中找到正确的文件?
【问题讨论】:
-
您的
head.html是否包含<link>到css/bootstrap.min.css?将其更改为/css/bootstrap.min.css。 -
解决了,谢谢!