Joshua Rosenberg
Joshua Rosenberg

Reputation: 4226

Hugo post directory appearing on homepage, but not posts

For my blogdown-created website (using the Xmin theme), the posts directory - from which I can view individual posts - appears on the homepage, instead of individual posts.

https://joshuamrosenberg.com/

enter image description here

This seemed to happen after updating to the lastest version of Hugo. The source for my website is here. I'm a bit puzzled about what to do: do you have any advice?

Upvotes: 3

Views: 1718

Answers (1)

Yihui Xie
Yihui Xie

Reputation: 30114

This is due to a breaking change in Hugo 0.57.0, and I have fixed the issue in the latest version of the XMin theme. Basically you need to replace

{{ range (where .Data.Pages "Section" "!=" "") }}

with

{{ $pages := .Pages }}
{{ if .IsHome }}{{ $pages = .Site.RegularPages }}{{ end }}
{{ range (where $pages "Section" "!=" "") }}

in the template file layouts/_default/list.html.

Upvotes: 4

Related Questions