Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How site.tags was generated ? #10

Open
Theigrams opened this issue Jul 24, 2021 · 0 comments
Open

How site.tags was generated ? #10

Theigrams opened this issue Jul 24, 2021 · 0 comments

Comments

@Theigrams
Copy link

I have a question that how site.tags was generated.

In your blog: Jekyll Tags on Github Pages · Long Qian, which said that site.tags was created by the liquid scripts follows:

{% assign rawtags = "" %}
{% for post in site.posts %}
  {% assign ttags = post.tags | join:'|' | append:'|' %}
  {% assign rawtags = rawtags | append:ttags %}
{% endfor %}
{% assign rawtags = rawtags | split:'|' | sort %}

{% assign site.tags = "" %}
{% for tag in rawtags %}
  {% if tag != "" %}
    {% if tags == "" %}
      {% assign tags = tag | split:'|' %}
    {% endif %}
    {% unless tags contains tag %}
      {% assign tags = tags | join:'|' | append:'|' | append:tag | split:'|' %}
    {% endunless %}
  {% endif %}
{% endfor %}

However, these operations in tags seem to have nothing to do with site.tags.

And how posts are included in tag[1] of site.tags?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant