<!– Collect tags from all posts –> {%- assign tags = blank -%} {%- for post in site.posts -%}
{%- assign post_tags = post.tags | join:'|' | append:'|' -%} {%- if post_tags != '|' -%} {%- assign tags = tags | append:post_tags -%} {%- endif -%}
{%- endfor -%} {%- assign tags = tags | split:'|' | uniq | sort -%}
<!– List tags & related posts –> {% for tag in tags %} <div class=“py-3”>
<h4 id="{{ tag | slugify }}">{{ tag }}</h4> <ol> {% for post in site.posts %} {%- if post.tags contains tag -%} {%- if post.external_url -%} {%- assign url = post.external_url -%} {%- else -%} {%- assign url = post.url | relative_url -%} {%- endif -%} <a href="{{ url }}"><li>{{ post.title }}</li></a> <small class="text-muted"> - {{ post.date | date_to_long_string }}</small> <br/> {%- endif -%} {% endfor %} </ol>
</div> <hr class=“bg-light”> {% endfor %}