jekyll-archives icon indicating copy to clipboard operation
jekyll-archives copied to clipboard

"wildcard" - get all tags

Open crysman opened this issue 3 years ago • 0 comments

Hi there, this is not an "issue", rather a question:

Is it possible to get all tags (like wildcarding *) on pages generated by jekyll? We've been using tags-topics (e.g. tags-topics: [ energy, science ]) and we've got several .md pages with different tags. I would like to have a single page merging all pages of all tags without actually adding a "fake" tag like "ALL" in every page...

We are using it like this:

{% if include.tags %}
{% assign sorted_full_tags = site.data.tags | sort_czech: "name-short" | sort: "is-scope", "last" %}
<div class="tags {{ include.container-class }}">
    {% for tag in sorted_full_tags %}
        {% if include.tags contains tag.id %}
            {% if include.highlighted == tag.id %}
            <a href="/" role="button" class="btn btn-tag btn-sm btn-tag-highlighted">
            {% elsif include.link %}
            <a href="/temata/{{ tag.id }}" role="button" class="btn btn-tag btn-sm btn-tag-link">
            {% else %}
            <div class="btn btn-tag btn-sm">
            {% endif %}
            {% if include.name-long %}{{ tag.name-long }}{% else %}{{ tag.name-short }}{% endif %}
            {% if include.highlighted == tag.id or include.link %}</a>{% else %}</div>{% endif %}
        {% endif %}
    {% endfor %}
</div>
{% endif %}

I am imagining something like an asterisk (*) to include all tags from everywhere, like imaginary

<a href="/temata/{{ tag.* }}" role="button" class="btn btn-tag btn-sm btn-tag-link">

(tag.* would be something like a word everything in the URL)

In simple words, to have a single page where ALL tags content is generated, no matter how these tags are named - like in bash, using * ... What is the best way to achieve this?

(I am sorry not to explain in best details possible, I am not one of the web programmers...) Thanks a lot.

crysman avatar Jan 24 '21 20:01 crysman