1
0

List categories in article info

This commit is contained in:
Emil Miler 2021-12-04 18:05:15 +01:00
parent e0ca8f1f2c
commit e20c485d03
3 changed files with 19 additions and 4 deletions

View File

@ -80,6 +80,16 @@ main {
border-top: 1px solid #eee;
margin: 2em 0;
padding: 1em 0;
ul {
list-style-type: none;
margin: 0;
padding: 0;
display: flex;
font-size: .85em;
li { margin-right: 1em }
}
}
img {
max-width: 100%;

View File

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

View File

@ -23,16 +23,20 @@
{%- if page.extra.author -%}
, <span class="author">{{ page.extra.author }}</span>
{% endif %}
{% if page.taxonomies.categories %}
<div class="taxonomy">
{{ self::list_taxonomy(kind="categories", prepend="#") }}
</div>
{% endif %}
</div>
{% endif %}
{% endmacro %}
{% macro list_taxonomy(title, kind) %}
<span class="title">{{ title }}</span>
{% macro list_taxonomy(kind, prepend="") %}
<ul>
{% set taxonomy = get_taxonomy(kind=kind) %}
{% for term in taxonomy.items %}
<li class="item"><a href="{{ term.permalink | safe }}">{{ term.name }}</a></li>
<li class="item"><a href="{{ term.permalink | safe }}">{{prepend}}{{ term.name }}</a></li>
{% endfor %}
</ul>
{% endmacro list_categories %}