fix: page taxonomies

This commit is contained in:
st1020 2023-10-22 21:55:06 +08:00
parent da8e715140
commit aa98b6e5e2

View file

@ -43,19 +43,26 @@
<hr /> <hr />
<!-- Post Taxonomies --> <!-- Post Taxonomies -->
{% if page.taxonomies.tags %} {% if page.taxonomies %}
<footer class="mt-12 flex flex-wrap"> <footer class="mt-12 flex flex-col">
{% set_global term_names = [] %}<!---->
{% for term_name, terms in page.taxonomies %}<!----> {% for term_name, terms in page.taxonomies %}<!---->
{% set_global term_names = term_names | concat(with=term_name) %}<!---->
{% endfor %}<!---->
{% for term_name in term_names | sort %}<!---->
<div class="mb-2 flex flex-wrap">
<span class="mb-1.5 mr-1.5 rounded-lg bg-black/[3%] px-5 py-1.5 dark:bg-white/[8%]" <span class="mb-1.5 mr-1.5 rounded-lg bg-black/[3%] px-5 py-1.5 dark:bg-white/[8%]"
>{{ term_name | title }} >{{ term_name | title }}
</span> </span>
{% for term in terms %}<!----> {% for term in page.taxonomies[term_name] %}<!---->
<a <a
class="mb-1.5 mr-1.5 rounded-lg bg-black/[3%] px-5 py-1.5 no-underline dark:bg-white/[8%]" class="mb-1.5 mr-1.5 rounded-lg bg-black/[3%] px-5 py-1.5 no-underline dark:bg-white/[8%]"
href="{{ get_taxonomy_url(kind=term_name, name=term) | safe }}" href="{{ get_taxonomy_url(kind=term_name, name=term) | safe }}"
>{{ term }}</a >{{ term }}</a
> >
{% endfor %} {% endfor %} {% endfor %}
</div>
{% endfor %}
</footer> </footer>
{% endif %} {% endif %}