Error calling Paginate: 'pager size' must be a positive integer

Running to an error for the command “hugo server”
below is the error and I am not sure how to fix it:

Error: Error building site: failed to render pages: render of "home" failed: "/Users/Anqi/Desktop/blog/anqi-adventure/themes/Blonde/layouts/_default/list.html:12:32": execute of template failed: template: _default/list.html:12:32: executing "main" at <.Paginate>: error calling Paginate: 'pager size' must be a positive integer```

Please share your site configuration.

Sorry, I am not quite understand how to share my site configuration. Can you tell me where can I find that? is there a command I need to run in terminal?

Copy paste the code inside your config.toml in a reply below, then highlight the code and click on the </> icon in the toolbar. Then post your reply.

1 Like
baseURL: "anqiadventure.github.io"
languageCode: en-us
title: Anqi Advendure
theme: Blonde
enableInlineShortcodes: true
enableRobotsTXT: true

the config file is in yml

If this is the theme you are using? GitHub - opera7133/Blonde: Blonde, A simple theme using Tailwind CSS.

yes, it is the theme I am using.

Then the error occurs in the line below. If I guess correctly, you need to add the main sections to your config.yml file. See here. and also define paginator_pages under params. But Joe can provide further assistance if that does not work.

@SapheSab3r

config.yaml

baseURL: "https://anqiadventure.github.io/"  # must include protocol and trailing slash
languageCode: en-us
title: Anqi Advendure
theme: Blonde
enableInlineShortcodes: true
enableRobotsTXT: true
params:
  paginator_pages: 10

Take a look at themes/Blonde/exampleSite/config.toml.

@tut

See https://gohugo.io/functions/where/#mainsections

If the user has not set this config parameter (site.Params.mainSections) in their site config, it will default to the section with the most pages .

I noticed that part just before you posted and made an edit. Never seen a theme deviate from using paginate and even fail to document it.

1 Like

The theme author seems to rely on exampleSite/config.toml for documentation. For example:
https://github.com/opera7133/Blonde/issues/118#issuecomment-1070229279

I just tried by following your solution. It worked! Thank you

Interesting! Beats the purpose of using a readme file.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.