Category template, mostly

This commit is contained in:
object-Object 2023-07-14 00:49:26 -04:00
parent 9059cfe6a5
commit 047907d4bb
2 changed files with 32 additions and 1 deletions

View file

@ -1 +1,16 @@
category goes here
{% import "macros.html.jinja" as macros %}
<section id="{{ category.id.path }}">
{% call macros.maybe_spoilered(category) %}
<h2 class="category-title page-header">
{{ category.name | hexdoc_block }}
{{ macros.jump_to_top() }}
{{ macros.permalink(category.id.path) }}
</h2>
{{ category.description | hexdoc_block }}
{% endcall %}
{% for entry in category.entries %}
{% if entry.id not in blacklist %}
entry
{% endif %}
{% endfor %}
</section>

View file

@ -9,3 +9,19 @@
{{- value.name -}}
</a>
{%- endmacro %}
{% macro maybe_spoilered(value) %}
{% if value.is_spoiler %}
<div class="spoilered">
{{ caller() }}
</div>
{% else %}
{{ caller() }}
{% endif %}
{%- endmacro %}
{% macro jump_to_top() %}
<a href="#table-of-contents" class="permalink small" title="Jump to top">
<i class="bi bi-box-arrow-up"></i>
</a>
{%- endmacro %}