Closed ericmjl closed 6 years ago
I just figured it out! The plugin provided the starting point reminder for me to look at querying the database.
For the benefit of future users who might want a starting point, here's my code below.
{% set blogposts = site.query('/blog') %}
{% set tags = [] %}
{% for post in blogposts %}
{% for tag in post.tags if tag not in tags %}
<!-- {{ tags.append(tag) }} -->
{% endfor %}
{% endfor %}
<ul>
{% for tag in tags|sort %}
<li><a href="{{ site.url_path }}/blog/tag/{{ tag }}">{{ tag }}</a></li>
{% endfor %}
</ul>
I'd like to create a page on my website that lists all of the tags that I have used. I'm not quite sure how to do this using
lektor-tags
, even though I have pored over the documentation quite a bit. Perhaps I'm not looking in the right place? Is there an example of how this can be accomplished?