Hi, I’m trying to create a daily collection page template.
I have 3 sections: notes, books, and articles.
If an entry matches the collection page’s date, it will be ranged.
Thank you.
Hi, I’m trying to create a daily collection page template.
I have 3 sections: notes, books, and articles.
If an entry matches the collection page’s date, it will be ranged.
Thank you.
Assuming a content structure like:
content/
├── articles/
│ ├── article-1.md
│ └── article-2.md
├── books/
│ ├── book-1.md
│ └── book-2.md
├── daily-collections/
│ ├── 2023-03-04.md
│ └── 2023-03-05.md
├── notes/
│ ├── note-1.md
│ └── note-2.md
└── _index.md
layouts/daily-collections/single.html
{{ $sections := slice "articles" "books" "notes" }}
{{ range where site.RegularPages "Section" "in" $sections }}
{{ if eq (.Date.UTC.Format "2006-01-02") ($.Date.UTC.Format "2006-01-02") }}
<h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
{{ end }}
{{ end }}
Thank you very much. It worked!