Closed Discostu36 closed 4 years ago
Hey!
Most likely, the issue is that the white-space around the tags isn't trimmed when looping through the pages in tags.twig
. The example in the readme is perhaps a little sloppy. Try changing this part:
{% if tag in pageTags %}
<div class="post">
<h3><a href="{{ page.url }}">{{ page.title }}</a></h3>
<p class="date">{{ page.date_formatted }}</p>
<p class="excerpt">{{ page.description }}</p>
</div>
{% endif %}
to this:
{% for pageTag in pageTags %}
{% if pageTag|trim == tag %}
<div class="post">
<h3><a href="{{ page.url }}">{{ page.title }}</a></h3>
<p class="date">{{ page.date_formatted }}</p>
<p class="excerpt">{{ page.description }}</p>
</div>
{% endif %}
{% endfor %}
Let me know if that solves the issue for you, and I'll update the readme.
As for your second problem with the sorting, there's simply nothing that sorts the tags right now. You can do it in twig by e.g. changing {% for tag in tags %}
to {% for tag in tags|sort %}
.
Thank you very much, it now works well!
I try to create a tag list as described in the README. But it doesn't work completely.
What works so far:
?tag=2000er
)What doesn't work
tags.twig
The template for the task list has this code (slightly changed from the one in Readme)
blog_post.twig
This is what I have added to each blog post for linking:
Rendered pages
For reference, here is the output: