在sections/article-template.liquid找到合适位置添加下列代码:
{%- if article.tags.size > 0 -%}
<div class="blogtags">
{%- for tag in article.tags -%}
{% if tag contains "_" %}{%- assign tag_starts_with = tag | slice: 0 -%}{% if tag_starts_with == "_" %}{% if tag_count %}{%- assign tag_count = tag_count | minus: 1 | at_least: 0 -%}{% endif %}{% continue %}{% endif %}{% endif %}
<a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a>
{%- endfor -%}
</div>
{%- endif -%}
CSS样式添加:
.blogtags a:before {
content: "|"; //多个tag用竖线分割
padding: 5px; //设置合理的间距
}
.blogtags a:first-child:before {
display: none; //第一个竖线不显示
}