Skip to content

Commit

Permalink
Merge pull request #50 from josh-justjosh/master
Browse files Browse the repository at this point in the history
Adds an Archive Page
  • Loading branch information
amitmerchant1990 committed Apr 22, 2021
2 parents 777220d + cd9462d commit 15ed2ba
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions _layouts/default.html
Expand Up @@ -32,6 +32,7 @@ <h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
<a href="{{ site.baseurl }}/getting-started">Getting Started</a>
<a href="{{ site.baseurl }}/search">Search</a>
<a href="{{ site.baseurl }}/about">About</a>
<a href="{{ site.baseurl }}/archive">Archive</a>
</nav>
</header>
</div>
Expand Down
33 changes: 33 additions & 0 deletions _pages/archive.md
@@ -0,0 +1,33 @@
---
layout: page
permalink: /archive/
title: Posts Archive
---


<div id="archives">
<section id="archive">
<h3>Most Recent Posts</h3>
{%for post in site.posts %}
{% unless post.next %}
<ul class="this">
{% else %}
{% capture month %}{{ post.date | date: '%B %Y' }}{% endcapture %}
{% capture nmonth %}{{ post.next.date | date: '%B %Y' }}{% endcapture %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
{% if year != nyear %}
</ul>
<h2 style="text-align:left;">{{ post.date | date: '%Y' }}</h2>
<ul class="past">
{% endif %}
{% if month != nmonth %}
<h3 style="text-align:left;">{{ post.date | date: '%B %Y' }}</h3>
{% endif %}
{% endunless %}
<p><b><a href="{{ site.baseurl }}{{ post.url }}">{% if post.title and post.title != "" %}{{post.title}}{% else %}{{post.excerpt |strip_html}}{%endif%}</a></b> - {% if post.date and post.date != "" %}{{ post.date | date: "%e %B %Y" }}{%endif%}</p>
{% endfor %}
</ul>
<h3>Oldest Posts</h3>
</section>
</div>

0 comments on commit 15ed2ba

Please sign in to comment.