JohnL4
JohnL4

Reputation: 1156

jekyll liquid directives not processed in github-pages main index.html; what am I missing?

Newbie question. I'm trying to get started with github-pages and Jekyll, working my way through the docs. I got to this: http://jekyllrb.com/docs/posts/#displaying-an-index-of-posts and I thought I'd put the Liquid directives directly into my main index.html, but they don't get processed. Instead, they just come out verbatim:

<ul>
  {% for post in site.posts %}
    <li><a href="{{ post.url }}">{{ post.title }}</a></li>
  {% endfor %}
</ul>

(Obviously, the HTML doesn't come out verbatim, but the Liquid stuff does.)

My directory structure (Created with the github automatic page generator):

./   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']

I've run bundle install and bundle update. I do have a post.

bundle exec jekyll serve serves everything up fine, except for this error/warning:

Configuration file: none

What am I missing?

(Thanks.)

Upvotes: 3

Views: 476

Answers (1)

JohnL4
JohnL4

Reputation: 1156

Ok, so... turns out all you need is to put "front matter" in your index.html to trigger its processing by Jekyll (http://jekyllrb.com/docs/frontmatter/). The minimal front matter is two lines of three dashes, which works for me.

On to the next hurdle!

Upvotes: 3

Related Questions