Skip to content

Instantly share code, notes, and snippets.

@jlisee
Forked from rey/archive.html
Last active December 23, 2015 02:08
Show Gist options
  • Select an option

  • Save jlisee/6564460 to your computer and use it in GitHub Desktop.

Select an option

Save jlisee/6564460 to your computer and use it in GitHub Desktop.

Revisions

  1. jlisee revised this gist Sep 14, 2013. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion archive.html
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    <section id="archive">

    {% capture this_year %}{{ site.time | date: '%Y' }}{% endcapture %}
    {% capture post_year %}{{ site.posts[0].date | date: '%Y' }}{% endcapture %}

  2. jlisee revised this gist Sep 14, 2013. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions archive.html
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,14 @@
    <section id="archive">

    {% capture this_year %}{{ site.time | date: '%Y' }}{% endcapture %}
    {% capture post_year %}{{ site.posts[0].date | date: '%Y' }}{% endcapture %}

    {% if this_year == post_year %}
    <h3>This year's posts</h3>
    {% else %}
    <h3>{{ post_year }}</h3>
    {% endif %}

    {%for post in site.posts %}
    {% unless post.next %}
    <ul class="this">
  3. Rey Dhuny renamed this gist Mar 12, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. Rey Dhuny revised this gist Mar 12, 2013. 1 changed file with 14 additions and 14 deletions.
    28 changes: 14 additions & 14 deletions gistfile1.html
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,18 @@
    <section id="archive">
    <h3>This year's posts</h3>
    {% for post in site.posts %}
    {% unless post.next %}
    <ul class="this">
    {% else %}
    {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
    {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
    {% if year != nyear %}
    </ul>
    <h3>{{ post.date | date: '%Y' }}</h3>
    <ul class="past">
    {% endif %}
    {% endunless %}
    <li><time>{{ post.date | date:"%d %b" }}</time><a href="{{ post.url }}">{{ post.title }}</a></li>
    {% endfor %}
    {%for post in site.posts %}
    {% unless post.next %}
    <ul class="this">
    {% else %}
    {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
    {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
    {% if year != nyear %}
    </ul>
    <h3>{{ post.date | date: '%Y' }}</h3>
    <ul class="past">
    {% endif %}
    {% endunless %}
    <li><time>{{ post.date | date:"%d %b" }}</time><a href="{{ post.url }}">{{ post.title }}</a></li>
    {% endfor %}
    </ul>
    </section>
  5. Rey Dhuny renamed this gist Mar 12, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. Rey Dhuny created this gist Mar 12, 2013.
    18 changes: 18 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    <section id="archive">
    <h3>This year's posts</h3>
    {% for post in site.posts %}
    {% unless post.next %}
    <ul class="this">
    {% else %}
    {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
    {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
    {% if year != nyear %}
    </ul>
    <h3>{{ post.date | date: '%Y' }}</h3>
    <ul class="past">
    {% endif %}
    {% endunless %}
    <li><time>{{ post.date | date:"%d %b" }}</time><a href="{{ post.url }}">{{ post.title }}</a></li>
    {% endfor %}
    </ul>
    </section>