Skip to content

Instantly share code, notes, and snippets.

@simonjodet
Created September 19, 2012 12:09
Show Gist options
  • Save simonjodet/3749322 to your computer and use it in GitHub Desktop.
Save simonjodet/3749322 to your computer and use it in GitHub Desktop.
Gumdrop: Example of index page and RSS feed
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Simon's Blog</title>
<link href="http://blog.jodet.com/atom.xml" rel="self"/>
<link href="http://blog.jodet.com/"/>
<updated>{{ pages|reverse[0].date|date(DATE_ATOM) }}</updated>
<id>http://blog.jodet.com/</id>
<author>
<name>Simon Jodet</name>
</author>
{% for page in pages|reverse %}
<entry>
<title>{{ page.title }}</title>
<link href="http://blog.jodet.com{{ page.location }}"/>
<updated>{{ page.date|date(DATE_ATOM) }}</updated>
<id>http://blog.jodet.com/{{ page.location }}</id>
<content type="html"><![CDATA[{{ page.html }}]]></content>
</entry>
{% endfor %}
</feed>
{% extends "_layout/default.twig" %}
{% block content %}
<ul class="unstyled" id="page-list">
{% for page in pages|reverse|slice(0,5) %}
<li class="page-list-item">
<div class="well">
<div class="page-header post-title">
<h3>
<a href="{{ page.location }}">{{ page.title }}</a><br/>
<small>Published on {{ page.date|date("Y-m-d") }}. Tags: {{ page.tags|join(', ') }}</small>
</h3>
</div>
<div style="margin-top:5px;">{{ page.html }}</div>
<div class="post-separator"></div>
</div>
</li>
{% endfor %}
<li class="page-list-item" id="page-list-item-tpl" style="display: none;opacity:0;">
<div class="well">
<div class="page-header post-title">
<h3>
<a href="__page.location__"></a><br/>
<small>Published on __page.date__. Tags: __page.tags__</small>
</h3>
</div>
<div style="margin-top:5px;" class="post-content"></div>
<div class="post-separator"></div>
</div>
</li>
</ul>
<div style="margin-bottom: 25px;" align="center">
<button class="btn btn-large btn-block" id="pagination_btn"><i class="icon-chevron-down" style="vertical-align: baseline;"></i>&nbsp;Display more posts&nbsp;<i class="icon-chevron-down" style="vertical-align: baseline;"></i></button>
</div>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment