Skip to content

Commit

Permalink
Update archive-year.html
Browse files Browse the repository at this point in the history
  • Loading branch information
janosrusiczki authored Oct 2, 2023
1 parent fbfcf6c commit 773f267
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions _layouts/archive-year.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

<h1 class="archive-title">Archive of posts from {{ page.date | date: "%Y" }}</h1>

<ul class="posts">
{% assign previous_month = '' %}
{% for post in page.posts %}
{% capture current_month %}{{ post.date | date: "%b" }}{% endcapture %}
{% capture current_month %}{{ post.date | date: "%B" }}{% endcapture %}
{% if current_month != previous_month %}
{% if previous_month != '' %}
</ul>
{% endif %}
{% assign previous_month = current_month %}
<h1>{{ current_month }}</h1>
<ul class="posts">
{% endif %}
<li>
<a class="post-link" href="{{ post.url }}">{{ post.title }}</a>
Expand Down

0 comments on commit 773f267

Please sign in to comment.