Paginate Single Folder from Home Page (News blog)

I’m sorry if this has already been discussed, I’m quite new to hugo.

So I have a site that doesn’t use blogs, it’s not a blog website, but the home page will have a listing of news posts. I want it to be paginated. What is the best way to do this?

I was thinking of two ways to accomplish this:

  • listing pages within a set directory is possible on the home page.
  • filtering posts by taxonomy

The first will be easier to use. I’m not sure how to set up the latter with pagination.

Thanks.

Thanks for pointing me in the right direction!

I didn’t see the use of the where function when I read it before. After playing with it for a while, I figured it out.

{{ range (.Paginate (where .Data.Pages "Section" "news")).Pages }}

The above code worked for me to display only the posts in the /news folder.

1 Like