Hi, i’m trying to make simple theme in hugo. I want to show list of posts in the partial posts_list.html
which is included in base_of.html
File structure:
content
- folder_1
- post_1.md
- post_2.md
- folder_2
- post_3.md
- post_4.md
baseof.html
<html>
{{- partial "head.html" . -}}
<body>
{{- partial "posts_list.html" . -}}
<div id="content">
{{- block "main" . }}{{- end }}
</div>
</body>
</html>
in posts_list.html
i’ve tried to use range:
{{ range .Pages }}
<p>{{ .Title }}</p>
{{ end }}
As a result i got this output on /index page
folder_1s (yes with s on the end out of nowhere)
folder_2s
and this on /folder_1:
post_1.md
post_2.md
- How to get rid of s? in the .Titles of directories?
- How to get this output on /index page:
folder_1
post_1.md
post_2.md
folder_2
post_3.md
post_4.md