get the 'all tags' function to work

This commit is contained in:
Bun 2025-07-01 22:06:38 -04:00
parent 2bea4c6dfd
commit 9fddbf763f
3 changed files with 34 additions and 22 deletions

View file

@ -4,15 +4,21 @@
<h1 class="title"> <h1 class="title">
{{ section.title }} {{ section.title }}
</h1> </h1>
<p class="larger">sort by <a href="/tags">tags</a>.</p>
<ul> <ul>
<!-- If you are using pagination, section.pages will be empty. <!-- If you are using pagination, section.pages will be empty.
You need to use the paginator object --> You need to use the paginator object -->
{% for page in section.pages %} {% for page in section.pages %}
<li> <li>
<a href="{{ page.permalink | safe }}">{{ page.title }}</a> - by {{ page.authors }}, <a href="{{ page.permalink | safe }}">{{ page.title }}</a> - by {{ page.authors }}
{{ page.date }}
<br> <br>
{{ page.description }} {{ page.description }}
<br>
written: {{ page.date }}
<br>
tags: {{ page.taxonomies.tags }}
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>

View file

@ -1,8 +1,21 @@
{% extends "base.html" %} {% extends "base.html" %}
{% if page.taxonomies.tags %} {%- block title -%}
tags: {{ title_macros::title(page_title="Tags", main_title=config.title) }}
{% for tag in page.taxonomies.tags %} {%- endblock -%}
<a href='{{ get_taxonomy_url(kind="tags", name=tag) | safe }}'>{{ tag }}</a>
{% block content %}
<div class="post">
<h1 class="post-title">all tags</h1>
<ul>
{% for term in terms %}
<li class="tag-list">
<a href="{{ term.permalink | safe }}">
{{ term.name }} ({{ term.pages | length }} post{{ term.pages | length | pluralize }})
</a>
</li>
{% endfor %} {% endfor %}
{% endif %} </ul>
</div>
{% endblock content %}

View file

@ -1,11 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block content %} {% block content %}
{% block title %}
{{ config.title }} &middot; <a href="/tags">tags</a> &middot; {{ term.name }}
{% endblock title %}
<h1>{{ term.name }}</h1> <h1>{{ term.name }}</h1>
<div class="page-intro"> <div class="page-intro">
@ -15,15 +10,13 @@
<ul class="postlist"> <ul class="postlist">
{% for page in term.pages | sort(attribute="date") | reverse %} {% for page in term.pages | sort(attribute="date") | reverse %}
<li class="postlist-item"> <li class="postlist-item">
{% if page.date %} <a href="{{ page.permalink | safe }}">{{ page.title }}</a> - by {{ page.authors }}
<div class="date"> <br>
<time class="postlist-date">{{ page.date }}</time> {{ page.description }}
</div> <br>
{% endif %} written: {{ page.date }}
<div class="postlist-head"> <br>
<h2><a class="postlist-title" href="{{ page.permalink }}">{{ page.title }}</a></h2> tags: {{ page.taxonomies.tags }}
</div>
<p class="postlist-description">{{ page.description }}</p>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>