Hugo add contact/about page that does not show as regular posts

129 Views Asked by At

I have all the posts under the following folder structure : content |--posts |--post1.md |--post2.md For these regular pages, my template layouts/_default/single.html is doing a good job. Now I wanted to add "contact" and "About us" pages. So I created following structure : content |--pages |--about.md |--contact.md And then I added layouts/pages/single.html template. Everything is working fine and my about and contact page are getting rendered with right template.

The only problem is that these about and contact pages are being shown as post pages in my landing page, where I was putting all the recent posts using {{ $post_paginator := .Paginate (.Site.RegularPages) 6 }}

How can I avoid these two pages from being shown in the posts? I tried something like .Paginate (where .Site.Pages "Type" "posts") 6. This solves the problem but it adds a new blank post for the /posts/ itself.

1

There are 1 best solutions below

0
Naveen On

I was able to fix this using .Paginate (where .Site.RegularPages "Section" "posts") 6.

More can be read from reference doc here.