-
Notifications
You must be signed in to change notification settings - Fork 299
/
Copy pathindex.html
57 lines (53 loc) · 2.13 KB
/
index.html
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
{% import "macros.html" as macros -%}
{% extends "layout.html" -%}
{% block page -%}
<header class="mt3 mt0-ns mb4-ns">
<div class="container flex flex-column flex-row-l justify-between-l">
<div class="mw6-l">
<p>{{ section.extra.index_html | safe }}</p>
</div>
</div>
<div class="container flex flex-column flex-row-l justify-between-l">
<div class="mw8-l">
<p>
<b>See also:</b>
{% for see_also in section.extra.see_also -%}
{% if loop.index0 != 0 %},{% endif %}
<a href="{{ config.base_url | safe }}{{ see_also.path | safe }}">{{ see_also.text }}</a>
{%- endfor -%}
</p>
</div>
</div>
</header>
<section id="posts" class="posts">
<div class="w-100 mw-none ph3 mw8-m mw9-l center f3">
<table class="post-list collapse w-100 f2-l f2-m f3-s">
{%- set rev_pages = section.pages | reverse %}
{%- for page in rev_pages %}
{%- set num_comps = page.components | length %}
{%- if num_comps < 4 %}{{ throw(message="Missing date in 'path' key, required format: '[inside-rust/]YYYY/MM/DD/slug-of-your-choice'") }}{% endif %}
{%- set year = page.components | nth(n=num_comps - 4) | int %}
{%- set month = page.components | nth(n=num_comps - 3) | int %}
{%- set day = page.components | nth(n=num_comps - 2) | int %}
{%- if loop.index0 == 0 %}
{{ macros::show_year(year=year) }}
{%- else %}
{%- set prev_idx = loop.index0 - 1 %}
{%- set prev_year = rev_pages[prev_idx].components | nth(n=num_comps - 4) | int %}
{%- if prev_year != year %}
{{ macros::show_year(year=year) }}
{%- endif %}
{%- endif %}
{% if page.show_year %}<tr>
<td class="bn"></td>
<td class="bn"><h3 class="f0-l f1-m f2-s mt4 mb0">Posts in {{ year }}</h3></td>
</tr>{% endif %}
<tr>
<td class="tr o-60 pr4 pr5-l bn">{{ macros::month_name(num=month) }} {{ day }}</td>
<td class="bn"><a href="{{ config.base_url | safe }}{{ page.path | safe }}">{{ macros::escape_hbs(input=page.title) }}</a></td>
</tr>
{%- endfor %}
</table>
</div>
</section>
{%- endblock page %}