Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add blog archive page #426

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions _layouts/archive.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
layout: page
---

<div class="home">
<div id="archive">
{% assign postsByYear = site.posts | group_by_exp:"post", "post.date | date: '%Y'" %}
<ul class="archive-clouds">
{% for year in postsByYear %}
<a href="#archive-{{ year.name | cgi_escape }}" class="archive-anchor">
<li>
{{ year.name | cgi_escape }} ({{year.items.size}})
</li>
</a>
{% endfor %}
</ul>
{% for year in postsByYear %}
<div class="archive-group">
<h4 id="archive-{{year.name}}" class="title">{{ year.name }} ({{year.items.size}})</h4>
<div class="items">
{% for post in year.items %}
<a href="{{ post.url | relative_url }}" class="archive-post-link">
<div class="item">
<p class="meta">{{ post.date | date: site.data.language.str_date_format | default: '%B %-d, %Y' }}</p>
<p class="title">{{ post.title }}</p>
</div>
</a>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
5 changes: 5 additions & 0 deletions _sass/layouts/_categories.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#archive,
#categories {
.archive-clouds,
.category-clouds {
margin: 30px 0 30px;

Expand Down Expand Up @@ -30,12 +32,14 @@
color: var(--header-text);
}

.archive-anchor:hover,
.category-anchor:hover {
text-decoration: none !important;
filter: none;
}
}

.archive-group,
.category-group {
padding: 15px 0 10px;

Expand Down Expand Up @@ -71,6 +75,7 @@
height: 100%;
}

.archive-post-link:hover,
.category-post-link:hover {
text-decoration: none;

Expand Down
9 changes: 9 additions & 0 deletions pages/archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: archive
title: "Blog Archive"
permalink: /archive/
hide: true
excluded: true
icon: "fa-archive"
position: 6
---
Loading