1
0

Enable taxonomies and list them in navigation

This commit is contained in:
Emil Miler 2021-12-03 22:59:23 +01:00
parent 5db0184653
commit e0ca8f1f2c
5 changed files with 17 additions and 6 deletions

View File

@ -3,6 +3,10 @@ title = "em.0x45.cz"
compile_sass = true
build_search_index = false
taxonomies = [
{name = "categories", feed = false}
]
[markdown]
highlight_code = true
smart_punctuation = true

View File

@ -0,0 +1 @@
{% extends "index.html" %}

View File

@ -0,0 +1 @@
{% extends "index.html" %}

View File

@ -16,12 +16,7 @@
<li><a href="{{ item.path }}">{{ item.title }}</a></li>
{% endfor %}
</ul>
<span class="title">Title</span>
<ul>
<li><a href="">anchor</a></li>
<li><a href="">anchor</a></li>
<li><a href="">anchor</a></li>
</ul>
{{ macros::list_taxonomy(title="Categories", kind="categories") }}
</aside>
<main>
{% block content %}

View File

@ -26,3 +26,13 @@
</div>
{% endif %}
{% endmacro %}
{% macro list_taxonomy(title, kind) %}
<span class="title">{{ title }}</span>
<ul>
{% set taxonomy = get_taxonomy(kind=kind) %}
{% for term in taxonomy.items %}
<li class="item"><a href="{{ term.permalink | safe }}">{{ term.name }}</a></li>
{% endfor %}
</ul>
{% endmacro list_categories %}