我正在为这个项目使用Tokiwa主题。
这是我的仓库的链接
在我的内容文件夹中,我按照参考图像中的方式组织了我的文件夹。
我想在主页上显示主要主题(写作)。如果你点击写作,我希望它把你带到一个显示子目录“诗歌”和“短篇小说”的列表页面,然后如果你点击其中任何一个,我希望它把你带到另一个显示所有内容的列表页面。我在同一层次结构中组织了其他广泛的主题,例如“编程”,我想为每个主题进行相同的设置。目前我的 list.html 是
{{ define "main" }}
<main>
<article>
<header>
<h1>{{.Title}}</h1>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{.Content}}
</article>
<ul>
<!-- Ranges through content/posts/*.md -->
{{ range .Pages }}
{{.Dir}}<br>
<li>
<a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a>
</li>
{{ end }}
</ul>
{{ end }}
在我的 content.toml 文件中
[menu]
[[menu.main]]
identifier = "writing"
name = "writing"
url = "/writing"
weight = 1
[[menu.main]]
identifier = "post"
name = "post"
url = "/post"
weight = 2
[[menu.main]]
identifier = "poems"
name = "poems"
url = "/category/poems"
parent = "writing"
weight = 1
[[menu.main]]
identifier = "stories"
name = "stories"
url = "/category/stories"
parent = "writing"
weight = 2
这似乎很接近,但并不完全正确。
感谢您在此问题上提供的任何帮助。