-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.mokkf
43 lines (40 loc) · 1.68 KB
/
archive.mokkf
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
---
layout: page
title: Archive
permalink: "/archive/index.html"
collection: pages
author: Club
markdown: false
---
<div class="search-article">
<label for="search-input" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="rgba(128,128,128,0.8)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search">
<circle cx="11" cy="11" r="8"></circle>
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
</svg>
</label>
<input type="search" id="search-input" placeholder="Search" aria-label="Search" />
</div>
<ul id="search-results"></ul>
{%- assign previous_year = 0 -%}
{% assign urls = '' | split: '' %}
{% assign post_date_rfc_3339 = collections["posts"] | map: 'date' | sort: "rfc_3339" %}
{%- for post_date in post_date_rfc_3339 reversed -%}
{%- for post in collections["posts"] -%}
{%- if post.date.rfc_3339 == post_date.rfc_3339 -%}
{%- unless urls contains post.url -%}
{% assign urls = urls | push: post.url %}
{%- capture current_year -%}{{ post.date.year }}{%- endcapture -%}
{%- unless current_year == previous_year -%}
<h2>{{ current_year }}</h2>
{%- assign previous_year = current_year -%}
{%- endunless -%}
<article class="post-item">
<h3 class="post-item-title">
<a href="{{ post.url | remove: 'index.html' | prepend: global.url }}">{% if post.data.tags contains "draft" %}<span class="post-updated-at post-meta">DRAFT</span> {% endif %}{{ post.data.title | escape }}</a>
</h3>
</article>
{%- endunless -%}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}