Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
Thank you! Looks similar what I want. Just days not sorted.
Am I correct understand how this works:
We created slice with maps with two keys: “month” - contains month’s number, “page” = contains Page type.
By sequence 1 to 12 we get pages with this sequence index and print link to it.
But I don’t understand why if I change this code
{{ range . }}
<a href="{{ .page.RelPermalink }}">{{ .page.LinkTitle }}</a><br>
{{ end }}
to this
{{ range sort .page.Date.Day }}
<a href="{{ .page.RelPermalink }}">{{ .page.LinkTitle }}</a><br>
{{ end }}
I’ve got an error:
failed to render pages: render of "page" failed: "C:\home\projects\hugo\liucalendar\layouts\calendar\single.html:17:23": execute of template failed at <.page.Date.Day>: can’t evaluate field page in type []map[string]interface {}
C:\home\projects\hugo\liucalendar\layouts\calendar\single.html:17:23:
<h3>{{ printf "%02d" $key }}</h2>
{{ range sort .page.Date.Day }}
<a href="{{ .page.RelPermalink }}">{{ .page.LinkTitle }}</a><br>
{{ end }}
git clone --single-branch -b hugo-forum-topic-39118 https://github.com/jmooring/hugo-testing hugo-forum-topic-39118
cd hugo-forum-topic-39118
hugo server