Skip to documentation content

Blog Topics

All complete examples

Demonstrate Blog Topics.

What this example teaches

  • Use Blog Topics as a reusable Liquid component
  • Keep custom fields on the template that owns them

View this pattern on the live demo site

Files

Tag list partial for linking to topic archives.

Liquid
{% comment %}
	Renders a list of tags/topics as links.

	Inputs:
		tags - collection of tag entities.
{% endcomment -%}
<ul class="taglist list-unstyled d-flex flex-wrap gap-2 mb-0">
	{%- for tag in tags -%}
		<li>{% if tag.has_url -%}
			<a href="{{ tag.full_url }}" class="badge rounded-pill text-bg-dark text-decoration-none px-3 py-2">{{ tag.title }}</a>
		{%- else -%}
			<span class="badge rounded-pill text-bg-dark px-3 py-2">{{ tag.title }}</span>
		{%- endif %}</li>
	{%- endfor -%}
</ul>