{"record":{"id":"b4fcd2b992af4502","repo":"gohugoio/hugo","slug":"too-many-arguments-pager-size-is-currently-the","errorCode":null,"errorMessage":"too many arguments, 'pager size' is currently the only option","messagePattern":"too many arguments, 'pager size' is currently the only option","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"resources/page/pagination.go","lineNumber":270,"sourceCode":"\t\t\t\tkey = kp.key\n\t\t\t\tpg = append(pg, PageGroup{Key: key})\n\t\t\t\tgroupIndex++\n\t\t\t}\n\t\t\tpg[groupIndex].Pages = append(pg[groupIndex].Pages, kp.page)\n\t\t}\n\t\tsplit = append(split, pg)\n\t}\n\n\treturn split\n}\n\nfunc ResolvePagerSize(conf config.AllProvider, options ...any) (int, error) {\n\tif len(options) == 0 {\n\t\treturn conf.Pagination().PagerSize, nil\n\t}\n\n\tif len(options) > 1 {\n\t\treturn -1, errors.New(\"too many arguments, 'pager size' is currently the only option\")\n\t}\n\n\tpas, err := cast.ToIntE(options[0])\n\n\tif err != nil || pas <= 0 {\n\t\treturn -1, errors.New((\"'pager size' must be a positive integer\"))\n\t}\n\n\treturn pas, nil\n}\n\nfunc Paginate(td TargetPathDescriptor, seq any, pagerSize int) (*Paginator, error) {\n\tif pagerSize <= 0 {\n\t\treturn nil, errors.New(\"'paginate' configuration setting must be positive to paginate\")\n\t}\n\n\turlFactory := newPaginationURLFactory(td)\n","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/resources/page/pagination.go#L252-L288","documentation":"`ResolvePagerSize` (pagination.go:264-271) accepts at most one option — the pager size. Passing more than one argument is ambiguous because no other option exists today, so the call is rejected.","triggerScenarios":"Calling `{{ .Paginate $pages 10 20 }}` or `{{ .Paginator 10 20 }}` — i.e. supplying two or more option arguments after the (optional) page set.","commonSituations":"Trying to pass both pager size and a sort/group option that doesn't exist; copy-paste adding an extra number; misunderstanding the variadic signature.","solutions":["Pass at most one argument: the pager size, e.g. `{{ .Paginate $pages 10 }}`.","For default pager size, pass no options: `{{ .Paginator }}`."],"exampleFix":"{{/* before */}}\n{{ .Paginate $pages 10 20 }}\n\n{{/* after */}}\n{{ .Paginate $pages 10 }}","handlingStrategy":"validation","validationCode":"if len(options) > 1 { return errors.New(\"too many arguments\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Paginator/Paginate take at most one option (pager size).","Omit options to use the configured default."],"tags":["hugo","templates","pagination","validation"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}