Add taxonomies (#18)

https://gohugo.io/content-management/taxonomies/
This commit is contained in:
Lukas Joswiak 2021-04-18 18:11:40 -07:00 committed by GitHub
parent 3e7256c7ea
commit b2941c2fcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

6
layouts/_default/li.html Normal file
View file

@ -0,0 +1,6 @@
<li>
<a href="{{ .Permalink }}">
{{ .Title }}
<small><time>{{ .Date.Format "Jan 2, 2006" }}</time></small>
</a>
</li>

View file

@ -0,0 +1,8 @@
{{ define "main" }}
<h3>{{ .Title }}</h3>
<ul id="posts">
{{- range .Pages }}
{{ .Render "li" }}
{{- end }}
</ul>
{{ end }}

View file

@ -1,11 +1,6 @@
<h3>Posts</h3>
<ul id="posts">
{{- range where site.RegularPages "Type" "in" site.Params.mainSections }}
<li>
<a href="{{ .Permalink }}">
{{ .Title }}
<small><time>{{ .Date.Format "Jan 2, 2006" }}</time></small>
</a>
</li>
{{ .Render "li" }}
{{- end }}
</ul>