Category template, mostly
This commit is contained in:
parent
9059cfe6a5
commit
047907d4bb
2 changed files with 32 additions and 1 deletions
17
doc/templates/category.html.jinja
vendored
17
doc/templates/category.html.jinja
vendored
|
@ -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>
|
16
doc/templates/macros.html.jinja
vendored
16
doc/templates/macros.html.jinja
vendored
|
@ -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 %}
|
||||
|
|
Loading…
Reference in a new issue