In my config.toml I’ve set paginate = 99 because I have fewer than 99 pages and I do not want pagination pages. When I run hugo, the public directory contains a page/1 directory. How do I tell hugo not to create the page directory. Looking at gohugo.io/getting-started/configuration/, the settings that might be related to a solution to this are these:
# Allows you to disable all page types and will render nothing related to 'kind';
# values = "page", "home", "section", "taxonomy", "taxonomyTerm", "RSS", "sitemap", "robotsTXT", "404"
disableKinds = []
:
# Pagination
paginate = 10
paginatePath = "page"
I tried setting paginate = 0 but that produced this error:
error calling Paginator: ‘paginate’ configuration setting must be positive to paginate
I tried your suggestions, but it did not work. I still see /tags/pages/... in the generated site, though there is no . Paginator reference from layouts/tags/list.html (therefore no pagination bar on the page).
This is basically the same as a separate tag.terms.html.
I faced the same problem, not with tags, but with just pages from a section in a list.html layout. I had a section subdirectory with just one file “1”.
As bep indicated, that’s the use of .Paginator that was causing the issue
I replaced:
{{ range .Paginator.Pages }}`
by:
{{ $section := .Section }}
{{ range where .Pages "Section" $section }}
and it fixed the issue.
(I know that it is not directly related, but that the first post about turning off pagination that comes out, so I thought it might help)
or some other large enough number. But make sure this setting is not underneath one of the other hash tables like [menu] or [parameters]. It needs to be a line in the top level section of the toml.
If this does not work then it indicates your layouts and other templates are probably mis-configured. Try some other theme or hugo template site in this case first, the idea is you can get it working, then back track to find out where your old site went wrong.