Skip to content

Instantly share code, notes, and snippets.

@frankV
Created June 18, 2014 23:57
Show Gist options
  • Save frankV/6822988cb886ef004488 to your computer and use it in GitHub Desktop.
Save frankV/6822988cb886ef004488 to your computer and use it in GitHub Desktop.
PelicanArticleLoopHack
<section class="wrapper style1 container special">
<div class="row">
<h2 class="space-above">Latest Posts</h2>
</div>
<div class="row">
{% for article in all_articles %}
{% if loop.index < 4 %}
<div class="4u">
<section>
<span class="icon feature fa-{{ article.icon }}"></span>
<header>
<a href="/{{ article.url }}" rel='bookmark'><h3>{{ article.title }}</h3></a>
</header>
<p>{{ article.content[:196]|striptags }}...</p>
<footer>
<ul class="buttons">
<li><a href="/{{ article.url }}" class="button small">Read More</a></li>
</ul>
</footer>
</section>
</div>
{% else %}
{% endif %}
{% endfor %}
</div>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment