summaryrefslogtreecommitdiff
path: root/posts/index.njk
blob: 3503bf6a694de9219d2d3eede6467275d19c05d0 (plain)
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
---js
{"layout": "page.njk",
"permalink": "index.html",
"eleventyExcludeFromCollections": true,
"eleventyComputed": {
  "metaDesc": "{{ metadata.subtitle }}",
  "pageTitle": "{{ metadata.title | safe }}",
  "previousPage": d => Math.ceil((d.collections.all.length-1)/5) }}
---
      <img id="logo" src="/favicon.png" alt="Blog Logo">
      <h1>{{ pageTitle }}<span id="title-btns"><a id="feed" title="RSS Feed" aria-label="RSS Feed" href="/feed.xml"></a><a id="message-me" title="Message Me" aria-label="Message Me" href="https://alexishovorka.com/TODO" target="_blank"></a></span></h1>
      <hr>

      {% set post = collections.all.slice(-1)[0] -%}
      <h2><a href="{{ post.url }}">{{ post.data.title }}</a></h2>
      {%- set postDate = post.date.toISOString().slice(0,10) %}
      <p class="post-date"><time datetime="{{ postDate }}">{{ postDate }}</time></p>

      {%- if post.data.heroImg %}
      <img class="hero" src="{{ post.data.heroImg }}" alt="{{ post.data.heroImgAlt }}">
      {%- endif %}

      {{ post.templateContent | fixAnchors(post.url) | safe }}

{%- if post.data.tags %}
      <p id="tags">{% for tag in post.data.tags %}
        <a class="tag" href="/{{ tag | slug }}/">#{{ tag }}</a>{% endfor %}
      </p>
{% endif %}

{%- if collections.all.length > 1 %}
      <nav>
        <a id="like-post" title="Like Post" aria-label="Like Post"><span></span></a>
        <a id="prev" rel="prev" href="/archive/{{ previousPage }}/">Older</a>
        <a id="first" rel="first" href="/archive/1/">First</a>
      </nav>
{% endif -%}