I’m working with a blog that has 5,500+ blog entries. Because of that, I disabled pagination since it didn’t make sense to have 500+ pages of pagination. I could never see anyone paging through all 5.5k posts.
I’ve decided I’d like to add a bit of pagination back to the site, but just for the 50 or so entries (5 pages). This was easy on the link side:
{{ if lt .Paginator.PageNumber 5 }} <nav id="page-nav"> {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }} {{ if .Paginator.HasPrev }} <a class="extend prev" rel="prev" href="{{.Paginator.Prev.URL}}"> « {{with .Site.Data.l10n.pagination.previous}}{{.}}{{end}} </a> {{ end }} {{ if .Paginator.HasNext }} <a class="extend next" rel="next" href="{{.Paginator.Next.URL}}"> {{with .Site.Data.l10n.pagination.next}}{{.}}{{end}} » </a> {{ end }} {{ end }} </nav> {{ end }}
But I noticed when I generated a static version of my site, Hugo generated all 500 pages of pagination. I looked at my pagination code in article_list.html. It was originally this:
I nuked all of public and I’m still seeing it. Not sure if this is related, but I also have /post/index.html listing all of my posts (5.5k+) full. I’m not too concerned about that - I can delete it in my build script, but I’m still seeing all the pages.
Your sites i a little big to test … but there are some fishy items here:
On the list pages you have the paginator partial included, yet it is not used … so you will get lots of paginator pages generated for that. For the index page I don’t see anything wrong, but I couldn’t test it.
Hmm. But the page this is used on ends up listing all the content, which I prefer since it gives a one stop place for everything for a particular tag or category. I’ll try disabling pagination here and see what happens.