Skip to content

Instantly share code, notes, and snippets.

@leonp
Created December 4, 2016 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leonp/63c81a9d2ee6676671e3bdef09a7afe0 to your computer and use it in GitHub Desktop.
Save leonp/63c81a9d2ee6676671e3bdef09a7afe0 to your computer and use it in GitHub Desktop.
Generating an advent calendar
{% assign advent_posts = (site.posts | where: "tag", "advent" | reverse ) %}
{% for post in advent_posts limit:24 %}
<article class="custom-flex-row pb2">
<p class="custom-icon-xmas-{{ forloop.index }} f4 ttu tracked dark-green ma0 mb2 pr2">{{ post.date | date: "%B %e" }}</p>
<a class="white" href="{{ post.url }}"><img class="custom-constrain-img" src="{{ post.featured-image }}" alt="{{ post.featured-alt }}"></a>
<h1 class="f5 fw6 ma0 pa0 pr2"><a href="{{ post.url }}" class="blue">{{ post.title }}</a></h1>
<p class="f5 ma0 pr2">{{ post.excerpt }}</p>
</article>
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment