3
votes

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.)

1
Does your index.html have a front matter section?matt
Bingo! Thank you, Matt & Stack Overflow.JohnL4

1 Answers

3
votes

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!