【发布时间】:2015-04-16 08:39:13
【问题描述】:
新手问题。我正在尝试开始使用 github-pages 和 Jekyll,按照自己的方式阅读文档。我得到了这个:http://jekyllrb.com/docs/posts/#displaying-an-index-of-posts,我想我会将 Liquid 指令直接放入我的主 index.html 中,但它们没有得到处理。相反,他们只是逐字逐句地出来:
<ul>
{% for post in site.posts %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
(很明显,HTML 不是逐字输出的,但 Liquid 的东西会。)
我的目录结构(使用github自动页面生成器创建):
./ Gemfile .git/ images/ javascripts/ _posts/ stylesheets/
../ Gemfile.lock .gitignore index.html params.json _site/
宝石文件:
source 'https://rubygems.org'
require 'json'
require 'open-uri'
versions = JSON.parse(open('https://pages.github.com/versions.json').read)
gem 'github-pages', versions['github-pages']
我运行过bundle install 和bundle update。我确实有一个帖子。
bundle exec jekyll serve 一切正常,除了这个错误/警告:
Configuration file: none
我错过了什么?
(谢谢。)
【问题讨论】:
-
你的
index.html有front matter section吗? -
宾果游戏!谢谢你,马特和堆栈溢出。
标签: jekyll liquid github-pages