Skip to content

Instantly share code, notes, and snippets.

@navilan
Created April 29, 2011 08:05
Show Gist options
  • Save navilan/948017 to your computer and use it in GitHub Desktop.
Save navilan/948017 to your computer and use it in GitHub Desktop.
Iterating over events - where integer key is an issue.
---
extends: base.j2
title: About BASIC
description: The default hyde template
events:
y2011:
-
title: "one event"
location: "a city"
-
title: "one event"
location: "a city"
y2010:
-
title: "one event"
location: "a city"
-
title: "one event"
location: "a city"
---
{% block main %}
{% for year, event_list in resource.meta.events %}
<h3>{{year|replace('y', '')}}</h3>
{% for event in event_list %}
<p> {{event.title}}, {{event.location}}</p>
{% endfor %}
{% endfor %}
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment