List categories in article info
This commit is contained in:
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
Reference in New Issue
Block a user