nasg/templates/Category.j2.html
Peter Molnar f47ed93fa0 once more with feeling: on-the-fly representation is schema.org json-ld for everything,
becase it's easy to write, forces me to use some sort of structure, and it might come handy.

However, the end HTML is microformats v1 and v2 - v1 for google, search engines, etc, v2 for anything indieweb.
2019-02-08 23:32:52 +00:00

61 lines
1.6 KiB
HTML

{% extends "base.j2.html" %}
{% block lang %}{% endblock %}
{% 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" />
<link rel="feed" title="{{ category.title}} feed" href="{{ category.url }}" />
{% 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 %}
{% block content %}
<main class="h-feed hatom">
<header>
<p>
<svg width="128" height="128"><use xlink:href="#icon-{{ category.name }}" /></svg>
</p>
</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>
{% endif %}
{% set _ = year.append(post.copyrightYear)%}
{% include 'meta-article.j2.html' %}
{% if loop.last %}
</section>
{% endif %}
{% endfor %}
</main>
{% endblock %}