2024-10-22
修改配置文件:config.toml
,添加一下:
taxonomies = [
{name = "tags"},
]
+++
...
[taxonomies]
tags = ["老钱和新钱", "投资"]
+++
{% extends "base.html" %}
{% block content %}
<h1>{{ taxonomy.name }}</h1>
<ul>
{% for term in terms %}
<li><a href="{{ term.permalink }}">{{ term.name }}</a> ({{ term.pages | length }} 篇文章)</li>
{% endfor %}
</ul>
{% endblock content %}
{% extends "base.html" %}
{% block content %}
<h1>{{ term.name }}</h1>
<ul>
{% for page in term.pages %}
<li>
<a href="{{ page.permalink }}">{{ page.title }}</a>
{% if page.date %}
<span class="date">{{ page.date | date(format="%Y-%m-%d") }}</span>
{% endif %}
</li>
{% endfor %}
</ul>
{% endblock content %}
现在你可以通过我的tags页面来访问tags。