-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchive.html
More file actions
58 lines (55 loc) · 2.23 KB
/
archive.html
File metadata and controls
58 lines (55 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
layout: page
title: Archive
description: 연도별로 정리된 모든 포스트
permalink: /archive/
---
<div class="archive-page">
{% assign postsByYear = site.posts | group_by_exp: "post", "post.date | date: '%Y'" %}
<!-- Stats -->
<div class="archive-stats">
<div class="archive-stat">
<span class="archive-stat-number">{{ site.posts.size }}</span>
<span class="archive-stat-label">Total Posts</span>
</div>
<div class="archive-stat">
<span class="archive-stat-number">{{ postsByYear.size }}</span>
<span class="archive-stat-label">Years</span>
</div>
</div>
{% for year in postsByYear %}
<section class="archive-year">
<h2 id="year-{{ year.name }}" class="archive-year-header">
<span class="archive-year-name">{{ year.name }}</span>
<span class="archive-year-count">{{ year.items.size }} posts</span>
</h2>
{% assign postsByMonth = year.items | group_by_exp: "post", "post.date | date: '%m'" %}
{% for month in postsByMonth %}
<div class="archive-month">
<h3 class="archive-month-header">
{% assign month_num = month.name | plus: 0 %}
{% case month_num %}
{% when 1 %}January{% when 2 %}February{% when 3 %}March{% when 4 %}April
{% when 5 %}May{% when 6 %}June{% when 7 %}July{% when 8 %}August
{% when 9 %}September{% when 10 %}October{% when 11 %}November{% when 12 %}December
{% endcase %}
<span class="archive-month-count">{{ month.items.size }}</span>
</h3>
<ul class="archive-list">
{% for post in month.items %}
<li class="archive-item">
<time datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%m. %d" }}</time>
{% if post.category %}
<span class="category-badge {{ post.category | downcase }}">{{ post.category }}</span>
{% elsif post.categories.first %}
<span class="category-badge {{ post.categories.first | downcase | replace: ' ', '-' }}">{{ post.categories.first }}</span>
{% endif %}
<a href="{{ post.url | relative_url }}" class="archive-item-title">{{ post.title | escape }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</section>
{% endfor %}
</div>