首页 文章

jekyll液体指令未在github-pages主index.html中处理;我错过了什么?

提问于
浏览
3

新手问题 . 我正在尝试使用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的确如此 . )

My directory structure (使用github自动页面生成器创建):

./   Gemfile       .git/       images/     javascripts/  _posts/  stylesheets/
../  Gemfile.lock  .gitignore  index.html  params.json   _site/

Gemfile:

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 installbundle update . 我有一个帖子 .

bundle exec jekyll serve 服务一切正常,除了此错误/警告:

Configuration file: none

我错过了什么?

(谢谢 . )

1 回答

  • 3

    好的,所以......结果你需要的是将"front matter"放在index.html中以触发Jekyll(http://jekyllrb.com/docs/frontmatter/)的处理 . 最小的前端是两行三个破折号,对我有用 .

    到了下一个障碍!

相关问题