mirror of
https://github.com/vinta/awesome-python.git
synced 2026-05-06 06:06:45 -04:00
feat(website): render subcategory, group, and source tags as anchor elements
Convert <button> tags for subcategory, group, and source filters to <a> elements with href attributes so browsers surface URL preview on hover, support open-in-new-tab, and allow middle-click navigation. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -169,9 +169,9 @@
|
||||
</td>
|
||||
<td class="col-cat">
|
||||
{% for subcat in entry.subcategories %}
|
||||
<button class="tag{% if subcat.url == current_path %} active{% endif %}" data-value="{{ subcat.value }}" data-url="{{ subcat.url }}">
|
||||
<a class="tag{% if subcat.url == current_path %} active{% endif %}" href="{{ subcat.url }}" data-value="{{ subcat.value }}" data-url="{{ subcat.url }}">
|
||||
{{ subcat.name }}
|
||||
</button>
|
||||
</a>
|
||||
{% endfor %}
|
||||
{% for cat in entry.categories %}
|
||||
<a
|
||||
@@ -184,22 +184,24 @@
|
||||
{% endfor %}
|
||||
{% if entry.groups %}
|
||||
{% set group_url = filter_urls[entry.groups[0]] %}
|
||||
<button
|
||||
<a
|
||||
class="tag tag-group{% if group_url == current_path %} active{% endif %}"
|
||||
href="{{ group_url }}"
|
||||
data-value="{{ entry.groups[0] }}"
|
||||
data-url="{{ group_url }}"
|
||||
>
|
||||
{{ entry.groups[0] }}
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if entry.source_type == 'Built-in' %}
|
||||
<button
|
||||
<a
|
||||
class="tag tag-source{% if '/categories/built-in/' == current_path %} active{% endif %}"
|
||||
href="/categories/built-in/"
|
||||
data-value="Built-in"
|
||||
data-url="/categories/built-in/"
|
||||
>
|
||||
Built-in
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="col-arrow"><span class="arrow">→</span></td>
|
||||
|
||||
@@ -220,9 +220,9 @@
|
||||
</td>
|
||||
<td class="col-cat">
|
||||
{% for subcat in entry.subcategories %}
|
||||
<button class="tag" data-value="{{ subcat.value }}" data-url="{{ subcat.url }}">
|
||||
<a class="tag" href="{{ subcat.url }}" data-value="{{ subcat.value }}" data-url="{{ subcat.url }}">
|
||||
{{ subcat.name }}
|
||||
</button>
|
||||
</a>
|
||||
{% endfor %} {% for cat in entry.categories %}
|
||||
<a
|
||||
class="tag"
|
||||
@@ -232,21 +232,23 @@
|
||||
>{{ cat }}</a
|
||||
>
|
||||
{% endfor %}
|
||||
<button
|
||||
<a
|
||||
class="tag tag-group"
|
||||
href="{{ filter_urls[entry.groups[0]] }}"
|
||||
data-value="{{ entry.groups[0] }}"
|
||||
data-url="{{ filter_urls[entry.groups[0]] }}"
|
||||
>
|
||||
{{ entry.groups[0] }}
|
||||
</button>
|
||||
</a>
|
||||
{% if entry.source_type == 'Built-in' %}
|
||||
<button
|
||||
<a
|
||||
class="tag tag-source"
|
||||
href="/categories/built-in/"
|
||||
data-value="Built-in"
|
||||
data-url="/categories/built-in/"
|
||||
>
|
||||
Built-in
|
||||
</button>
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="col-arrow"><span class="arrow">→</span></td>
|
||||
|
||||
Reference in New Issue
Block a user