CaiJimmy / hugo-theme-stack-starter

A quickstart template to create a Hugo blog using hugo-theme-stack
https://demo.stack.jimmycai.com
MIT License
305 stars 105 forks source link

How to set categories page and tags page? #34

Closed jackadam1981 closed 7 months ago

jackadam1981 commented 7 months ago

I want to add these two pages on the left sidebar.

jackadam1981 commented 7 months ago

create /layouts/taxonomy/category.html {{ define "main" }}

Category

{{ .Content }}

{{ end }}

create /layouts/taxonomy/tags.html {{ define "main" }}

tags

{{ .Content }}

{{- with .Site.Taxonomies.tags -}}

{{- range $name, $taxonomy := . -}} {{ $name }} {{- end -}}

{{- end -}}

{{ end }}

set menu

[menu]

[[menu.main]] name = "categories" url = "/categories/" weight = 3 [menu.main.params] icon = "categories"

[[menu.main]] name = "tags" url = "/tags/" weight = 4 [menu.main.params] icon = "tag"