Skip to content

Commit 636db41

Browse files
committed
fix: update the URL path of the category tags
1 parent 7b223bd commit 636db41

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

templates/v3/includes/_library_item.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
library_url (string, optional) - Link for the library name
88
description (string, required) - Short library description
99
categories (list, required) - List of {label, slug, variant} dicts for category tags
10-
version_str (string, required) - Version, used for url construction
1110
cpp_version (string, required) - e.g. "C++ 14" — rendered as neutral tag
1211
author (dict, required) - Author object for _user_profile.html (name, role, avatar_url, badge)
1312
doc_url (string, required) - Documentation link URL
@@ -31,8 +30,11 @@
3130
<p class="library-item__description">{{ description }}</p>
3231
<div class="library-item__tags">
3332
{% for cat in categories %}
34-
{% url 'libraries-list' category_slug=cat.slug library_view_str=variant version_slug=version_str as cat_url %}
35-
{% include "v3/includes/_category_tag.html" with tag_label=cat.label url=cat_url variant=cat.variant only %}
33+
{% if request.GET %}
34+
{% include "v3/includes/_category_tag.html" with tag_label=cat.label url=request.get_full_path|add:"&category="|add:cat.slug variant=cat.variant only %}
35+
{% else %}
36+
{% include "v3/includes/_category_tag.html" with tag_label=cat.label url=request.path|add:"?category="|add:cat.slug variant=cat.variant only %}
37+
{% endif %}
3638
{% endfor %}
3739
<span class="version-tag version-tag--default library-item__cpp-version">{% if cpp_version %}C++ {{ cpp_version|cut:"C++" }}{% else %}Unknown{% endif %}</span>
3840
</div>

0 commit comments

Comments
 (0)