我要做的是设置我的网站,以便它有博客文章,博客,然后是主页。
从我在https://github.com/mojombo/jekyll/wiki/Usage读到的内容,我应该能够在我的根目录(包含index.htm,_site,_posts等的目录)中放置一个html文件,只要它有YML即可前面的问题,Jekyll应该在运行命令时将它添加到我的_site目录。
我目前有一个名为2011-03-140-blog.html的文件,如下所示:
---
permalink: /blog
---
<div id="posts">
{% for post in site.posts offset: 0 limit: 10 %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
{{ post.date | date_to_string }}
{{ post.content }}
{% endfor %}
</div>
当我运行jekyll --server时,我得到以下内容:
Configuration from /Users/noahclark/Sites/noahc/_config.yml
Building site: /Users/noahclark/Sites/noahc -> /Users/noahclark/Sites/noahc/_site
/Library/Ruby/Gems/1.8/gems/jekyll-0.10.0/bin/../lib/jekyll/page.rb:115:in `initialize': Is a directory - /Users/noahclark/Sites/noahc/_site/blog (Errno::EISDIR)
from /Library/Ruby/Gems/1.8/gems/jekyll-0.10.0/bin/../lib/jekyll/page.rb:115:in `open'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.10.0/bin/../lib/jekyll/page.rb:115:in `write'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.10.0/bin/../lib/jekyll/site.rb:194:in `write'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.10.0/bin/../lib/jekyll/site.rb:193:in `each'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.10.0/bin/../lib/jekyll/site.rb:193:in `write'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.10.0/bin/../lib/jekyll/site.rb:83:in `process'
from /Library/Ruby/Gems/1.8/gems/jekyll-0.10.0/bin/jekyll:164
from /usr/bin/jekyll:19:in `load'
from /usr/bin/jekyll:19
任何想法,我做错了什么?
答案 0 :(得分:3)
将permalink: /blog
更改为permalink: /blog.html
应该可以解决这个问题。