๐Ÿ“ฆ jieyouxu / blog

๐Ÿ“„ post_taxonomies.html ยท 21 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21{% if page.taxonomies %}
<footer class="mt-12 flex flex-col">
  {% set_global term_names = [] %}<!---->
  {% 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="block-bg mb-1.5 mr-1.5 rounded-lg px-5 py-1.5">{{ term_name | title }} </span>
    {% for term in page.taxonomies[term_name] %}
    <a
      class="block-bg block-hover mb-1.5 mr-1.5 rounded-lg px-5 py-1.5 no-underline"
      href="{{ get_taxonomy_url(kind=term_name, name=term) | safe }}"
      >{{ term }}</a
    >
    {% endfor %}
  </div>
  {% endfor %}
</footer>
{% endif %}