0
votes

I can't seem to get some very basic ruby to work within Jekyll. I have an ultra-simple loop to get my posts from inside /_posts :

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

The posts inside _posts are called

2013-03-16-how-i-do.md
2012-01-01-hello-world.md

Inside _config.yml, I've set permalink: pretty.

What's odd is that it doesn't seem to even iterate through that loop at all— if I add some text inside the loop, even before the li, it doesn't post show up at all.

I'm currently using ruby-2.0.0-p0 — have there been any syntax changes that might be causing this?

Thank you!

1
Just out of curiosity, do you have a preamble, setting title in your _posts/* (looking like ---\nlayout: post\ntitle: "Fancy Title"\n…\n---?)Aleksei Matiushkin

1 Answers

3
votes

First of all are you calling {{ content }} so that Jekyll knows where to run the query?

If you are then this is how I am calling my posts

{% for post in site.posts limit: 10 %}  

  <a href="{{post.url}}">{{ post.title }}   

  {{ post.date | date:"%B %d, %Y" }}

 {% endfor %}