Starting with Hugo. Can't see list of posts

Hi,

I’m starting with Hugo and never ever seen anything more complex than this. I read the documentation but still it’s not working as expected.

So I created my blog site and I created several folders in my content folder. This is going to be a multilingual post, so I’ve created a folder in content folder for each language. I want to list my posts in the home page, it should be easy but when I do this

{{ $totalPosts := len .Site.RegularPages }}

Total de posts: {{ $totalPosts }}

{{ range .Site.AllPages }}

{{ .LinkTitle }}

{{ end }}

Nothing is coming, 0 posts, but I can see the full list when I do in my console hugo list all.

I tried creating a new folder under content called posts and entering there new folders with posts, but it’s not working either.

My structure is
content/
en/
nasa/_index.md
iceHotel/_index.md

You can snoop in my repo here: https://gitlab.com/mytraveltreasuryappsandclouds/Blog

any ideas what’s wrong here?

Thanks!

https://gitlab.com/mytraveltreasuryappsandclouds/Blog → 404

Is it a problem with your account? I can see it without problem.

You repo is probably private.

I created a copy here GitHub - robergimenez/hugo

Your site does not have any .RegularPages…

image

They are all section pages.

See https://gohugo.io/quick-reference/page-collections/

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.