Pages return the directories instead of pages

Content directory:

content
  angular
    get-started.md
  reactjs
    get-started.md

index.html:

{{ range .Pages }}
<section class="post">
	<header class="post-header">
		<h2 class="post-title"><a href="{{.Permalink}}">{{.Title}}</a></h2>
	</header>
	<div class="post-description">
		<p>{{.Summary}}</p>
	</div>
</section>
{{ end }}

In my opinion, the home page should list all the pages(/angular/get-started and reactjs/get-starated in my case), however it list the angular and reactjs:

What’s going on?

Also, why it add the s after the directory name angular?


Hugo Static Site Generator v0.59.1-D5DAB232

BTW, I followed this video and refer to this layout

There was a breaking change in Hugo 0.57.0 that affected the homepage/index page collection.

You can look it up in the release notes and this issue

That is what’s going on.

By the way the best source for Hugo themes is the Hugo Showcase always up-to-date with themes that work with the latest version of Hugo.

And the best way to learn Hugo are the always up-to-date Hugo Docs

Not some random video or theme from 2017.

Thanks for your reply.

But the hugo docs I found here does not mention the .Site.RegularPages. Also the video I followed is provided by hugo docs.

Thank you anyway, the problem have been solved.

Thanks for pointing out the above.

I’m not maintaining or contributing to the Hugo Docs myself as my available time goes towards maintaining other repositories of the project.

But I am notifying some people at the bottom of this post about the outdated documentation regarding the Homepage Pages Collection located over here:

.Pages needs to become .Site.RegularPages

And the outdated video from Giraffe Academy probably needs to be removed from here as well.

cc: @kaushalmodi @bep

1 Like