I am not overly familiar with git or GitHub at this point, but I have attempted to add my files to a repo for the sake of this post: GitHub - thejollyfrog/vg2
(apologies if I have done this incorrectly).
I am a graphic designer with some code knowledge and theme building experience in Ghost. I am using Hugo (0.83.1) on Manjaro Linux.
I have only been learning Hugo for a week, but I have successfully completed a Hugo rebuild of the following website: veggieguide.co.uk (a ghost website which I built) aside from one thing: excluding pages from the index page when using range.
What I have tried:
{{ range .Paginator.Pages }} successfully loops through my posts, with pagination, but includes pages I wish to leave out which are not in the “blog” directory.
{{ range (where .Site.RegularPages “Type” “blog” )}} successfully displays the blog pages without the excluded pages (which are not in the “blog” directory), but all blog posts (50) are displayed on the page.
I have read and reread the documentation, but my comprehension of it is obviously lacking. I have attempted to use the suggested code (slightly adapted) with no luck:
{{ $paginator := .Paginate (where .Pages “Type” “blog”) }}
{{ template “_internal/pagination.html” . }}
{{ range $paginator.Pages }}
In this case, I get one post with the name “Blogs”?. When clicked, the post leads to a blank page.
What did I expect?
I was hoping that pages such as the about page, contact page etc. could be excluded from the range.
–
I love Hugo, it has been fun to work with, and I plan to document the process of building a theme from scratch for others who may benefit.
I have done my best to research this issue and found similar issues, but I was unable to find a usable solution for my specific issue.
Your guide stated to start a new issue rather than resurrect an old one.
My content structure is as follows:
content
- blog
- postname1
- index.md
- postname2
- index.md
- postname3
- index.md
- pagename1
- index.md
Any help on this would be very much appreciated.