【发布时间】:2015-02-03 10:45:23
【问题描述】:
我正在与 jekyll 合作制作一个小型网站。因为我们想隐藏帖子的日期,所以我使用固定链接。
在 localhost 上,index.html 显示良好,包含正确的 css。
浏览器正在从以下位置获取 css:
127.0.0.1:4000/css/styles.css
当我要发帖时,我的 css 不见了,因为浏览器正在这里寻找 css:
127.0.0.1:4000/permalink/css/styles.css
这是我的 config.yaml 的样子(我使用 // 当我需要隐藏信息时):
# Site settings
title: //
email: //•//.fr
description: > # this means to ignore newlines until "baseurl:"
//.
baseurl: "" # the subpath of your site, e.g. /blog/
url: "http://127.0.0.1:4000" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username: jekyll
# Build settings
markdown: kramdown
relative_permalinks: true
sass:
style: :compressed
sass_dir: _sass
还有include/head.html:
<!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]-->
<script src="{{ "/js/jquery.min.js" | prepend: site.baseurl }}"></script>
<script src="{{ "/js/jquery.scrollzer.min.js" | prepend: site.baseurl }}"></script>
<script src="{{ "/js/jquery.scrolly.min.js" | prepend: site.baseurl }}"></script>
<script src="{{ "/js/skel.min.js" | prepend: site.baseurl }}"></script>
<script src="{{ "/js/skel-layers.min.js" | prepend: site.baseurl }}"></script>
<script src="{{ "/js/init.js" | prepend: site.baseurl }}"></script>
<noscript>
<link rel="stylesheet" href="{{ site.baseurl }}css/skel.css"/>
<link rel="stylesheet" href="{{ site.baseurl }}css/style.css"/>
<link rel="stylesheet" href="{{ site.baseurl }}css/style-xlarge.css"/>
</noscript>
<!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]-->
找到javascript文件没有问题,这就是为什么我认为href/src文件调用中有一些东西。
如果有人有想法,我会很高兴。
非常感谢。 朱
【问题讨论】:
标签: html css jekyll permalinks