refactor(tags): avoid URL errors caused by improper site.baseurl settings

Resolves #580
This commit is contained in:
Cotes Chung 2022-05-24 16:33:42 +08:00
parent 94e81447af
commit 12f1e6fe89
No known key found for this signature in database
GPG key ID: 0D9E54843167A808

View file

@ -14,7 +14,9 @@ layout: page
{% for t in sorted_tags %}
<div>
<a class="tag" href="{{ site.baseurl }}/tags/{{ t | slugify | url_encode }}/">{{ t }}<span class="text-muted">{{ site.tags[t].size }}</span></a>
<a class="tag" href="{{ t | slugify | url_encode | prepend: '/tags/' | append: '/' | relative_url }}">
{{ t }}<span class="text-muted">{{ site.tags[t].size }}</span>
</a>
</div>
{% endfor %}