I am trying to implement a list template.
HUGO version is v0.80.0.
_index.md
has not date property in frontmatter but a listing page renders date using the date property of a regular page in the same hierarchy.
Why does print a date?
I have the following structure:
.
├── branch_a
│ ├── _index.md <-- not have a date in frontmatter
│ └── foo.md <-- have a date in frontmatter
├── branch_b
layouts/_default/list.html
looks like:
<ul>
{{- range (.Paginate .Sections).Pages -}}
{{ if .Date }}<li>{{ .Title }}: {{ .Date }}</li>{{ end }}
{{- end -}}
<ul>
content/branch_a/_index.md
:
---
title: Section A
---
content/branch_a/foo.md
:
---
title: foo
date: '2016-05-16T22:46:57Z'
---
The rendering result(http://localhost:1313/branch_a/) is following as:
- Section A: 05/16/2016
- foo: 05/16/2016
Thank you in advance.