Add tag index rendering
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
{% extends "base.html" %}
|
||||
{% set prefix = (section + "/") if section else (("tags/" + tag + "/") if tag else "") %}
|
||||
{% set heading = section or tag or "" %}
|
||||
|
||||
{% block title %}{% if section %}{{ section }} — {% endif %}{{ site.name }}{% if page_num > 1 %} — Page {{ page_num }}{% endif %}{% endblock %}
|
||||
{% block title %}{% if heading %}{{ heading }} — {% endif %}{{ site.name }}{% if page_num > 1 %} — Page {{ page_num }}{% endif %}{% endblock %}
|
||||
|
||||
{% block head %}<link rel="canonical" href="{{ site.origin }}{{ site.base_dir }}{% if section %}{{ section }}/{% endif %}{% if page_num == 1 %}{% else %}page-{{ page_num }}.html{% endif %}">{% endblock %}
|
||||
{% block head %}
|
||||
<link rel="canonical" href="{{ site.origin }}{{ site.base_dir }}{{ prefix }}{% if page_num > 1 %}page-{{ page_num }}.html{% endif %}">
|
||||
{% if page_num > 1 %}<meta name="robots" content="noindex, follow">{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
{% if section %}<h1>{{ section }}</h1>{% endif %}
|
||||
{% if heading %}<h1>{{ heading }}</h1>{% endif %}
|
||||
{% for item in items %}
|
||||
<article>
|
||||
<header>
|
||||
@@ -18,15 +23,15 @@
|
||||
{% if total_pages > 1 %}
|
||||
<nav>
|
||||
{% if page_num > 1 %}
|
||||
<a href="{{ site.base_dir }}{% if section %}{{ section }}/{% endif %}page-{{ page_num - 1 }}.html">← Newer</a>
|
||||
<a href="{{ site.base_dir }}{{ prefix }}page-{{ page_num - 1 }}.html">← Newer</a>
|
||||
{% endif %}
|
||||
{% for p in range(1, total_pages + 1) %}
|
||||
{% if p == page_num %}<strong>{{ p }}</strong>
|
||||
{% else %}<a href="{{ site.base_dir }}{% if section %}{{ section }}/{% endif %}page-{{ p }}.html">{{ p }}</a>
|
||||
{% else %}<a href="{{ site.base_dir }}{{ prefix }}page-{{ p }}.html">{{ p }}</a>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if page_num < total_pages %}
|
||||
<a href="{{ site.base_dir }}{% if section %}{{ section }}/{% endif %}page-{{ page_num + 1 }}.html">Older →</a>
|
||||
<a href="{{ site.base_dir }}{{ prefix }}page-{{ page_num + 1 }}.html">Older →</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user