-
Notifications
You must be signed in to change notification settings - Fork 0
/
post.njk
60 lines (54 loc) · 2.14 KB
/
post.njk
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
59
60
---
layout: layouts/base.njk
templateClass: tmpl-post prose
bodyClass: radial-mid
---
<div class="mt-content feature text-center mb-2">
<time class="text-small font-mono" datetime="{{ page.date | htmlDateString }}">{{ page.date | readableDate }}</time>
<h1 class="mb-0 wrap-balance">{{ title }}</h1>
<span class="inline-block">
{%- for tag in tags | filterTagList | sort() %}
{%- set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<a href="{{ tagUrl | url }}" class="post-tag">{{ tag }}</a>
{%- endfor %}
</span>
</div>
{{ content | safe }}
<div class="mt-2">
<p class="section-eyebrow m-0 color-accent">Newsletter</p>
<p>Want to receive these thoughts and others <a href="{{ '/newsletter' | url }}">in your inbox?</a></p>
</div>
<div class="mt-2">
<p class="section-eyebrow m-0 color-accent">Discussion</p>
{% set mailitems = ['mailto:', metadata.author.email, '?subject=Re:', title] %}
<p>Want to discuss this?
<a href="{{ mailitems | join }}">Email Me</a>
</p>
</div>
{%- if collections.posts %}
{%- set nextPost = collections.posts | getNextCollectionItem(page) %}
{%- set previousPost = collections.posts | getPreviousCollectionItem(page) %}
{%- if nextPost or previousPost %}
<div class="feature py-1 color-reduced mt-2">
<ul class="content-inner flex justify-between list-none p-0 m-0 w-full">
<li class="grow w-1/2">
<span class="uppercase decoration-none text-small">Previous:</span><br/>
{%- if previousPost %}
<a href="{{ previousPost.url | url }}" class="decoration-none font-thin font-bold">{{ previousPost.data.title }}<br/>←</a></li>
{% else %}
<span class="font-thin font-bold">You're at the very beginning!<br/>🙃</span>
</li>
{% endif %}
<li class="text-right grow w-1/2">
<span class="uppercase decoration-none text-small">Next:</span>
<br/>
{%- if nextPost %}
<a href="{{ nextPost.url | url }}" class="decoration-none font-thin font-bold">{{ nextPost.data.title }}<br/>→</a>
{% else %}
<span class="font-thin font-bold">You're all caught up!<br/>😎</span>
{% endif %}
</li>
</ul>
</div>
{%- endif %}
{%- endif %}