Hi all.
I’m making a material design theme for hugo. On the frontpage, I want to render the most recent post with a certain template, and the 2nd to 10th most recent posts with a different template.
So far I have:
{{ range first 10 (where .Site.Pages "Section" "post") }}
{{ .Render "card" }}
{{ end }}
How can I modify the above code to accomplish this? Is there a way to attach an index
so I could do something like:
{{ range first 10 (where .Site.Pages "Section" "post") }}
{{if eq index 1}}
{{ .Render "card1" }}
{{else}}
{{ .Render "card2" }}
{{end}}
{{ end }}
I’m new to Go, and haven’t had much luck googling around. Any help is appreciated!