all repos — htmlepessoas.com @ main

Venha aprender HTML com um método simplificado.

src/_includes/chapter.njk (view raw)

 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
{% extends "base.njk" %}

{% block content %}
  {{ content | safe }}
  {% set previousPost = collections.sortedChapter | getPreviousCollectionItem %}
  {% set nextPost = collections.sortedChapter | getNextCollectionItem %}

  {% if previousPost or nextPost %}
    <nav
      class="mb-xl"
      style="display: flex; flex-direction: column; gap: 0.5rem;"
    >
      {% if nextPost %}
        <p>
          <strong><span role="presentation">&rarr;</span> Próximo capítulo:</strong>
          <a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a>
        </p>
      {% endif %}

      {% if previousPost %}
        <p>
          <strong
            ><span role="presentation">&larr;</span> Capítulo anterior:</strong
          >
          <a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a>
        </p>
      {% endif %}
    </nav>
  {% endif %}
{% endblock %}

{% block after_main %}
{% endblock %}