nasg/templates/Category.j2.html

62 lines
1.6 KiB
HTML
Raw Normal View History

2018-07-20 16:45:42 +01:00
{% extends "base.j2.html" %}
{% block lang %}{% endblock %}
2018-07-20 16:45:42 +01:00
{% block title %}{{ category.title }}{% endblock %}
{% block meta %}
<link rel="alternate" type="application/rss+xml" title="{{ category.title }} RSS feed" href="{{ category.feed }}" />
<link rel="alternate" type="application/atom+xml" title="{{ category.title }} ATOM feed" href="{{ category.feed }}atom.xml" />
2019-01-15 21:28:58 +00:00
<link rel="feed" title="{{ category.title}} feed" href="{{ category.url }}" />
2018-07-20 16:45:42 +01:00
{% endblock %}
{% block pagination %}
{% if category.paginated %}
<nav>
<ul>
{% for y, url in category.years.items() %}
{% if y == category.year %}
<li>
<span>
{{ y }}
</span>
</li>
{% else %}
<li>
<a href="{{ url }}">
<strong>{{ y }}</strong>
</a>
</li>
{% endif %}
{% endfor %}
</ul>
</nav>
{% endif %}
{% endblock %}
2018-07-20 16:45:42 +01:00
{% block content %}
<main class="h-feed hfeed">
2018-07-20 16:45:42 +01:00
<header>
<p>
<svg width="128" height="128"><use xlink:href="#icon-{{ category.name }}" /></svg>
</p>
2018-07-20 16:45:42 +01:00
</header>
{% set year = [0] %}
{% for post in posts %}
{% set _year = year.pop() %}
{% if not category.paginated and _year != post.copyrightYear %}
{% if not loop.first %}
</section>
{% endif %}
<section>
<h2>{{ post.copyrightYear }}</h2>
2018-07-20 16:45:42 +01:00
{% endif %}
{% set _ = year.append(post.copyrightYear)%}
{% include 'meta-article.j2.html' %}
{% if loop.last %}
</section>
{% endif %}
2018-07-20 16:45:42 +01:00
{% endfor %}
</main>
2018-07-20 16:45:42 +01:00
{% endblock %}