{"record":{"id":"887557f00187e549","repo":"gohugoio/hugo","slug":"pagination-not-supported-for-this-page","errorCode":null,"errorMessage":"pagination not supported for this page","messagePattern":"pagination not supported for this page","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"hugolib/page__output.go","lineNumber":28,"sourceCode":"// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage hugolib\n\nimport (\n\t\"fmt\"\n\t\"path\"\n\t\"strings\"\n\n\t\"github.com/gohugoio/hugo/identity\"\n\t\"github.com/gohugoio/hugo/output\"\n\t\"github.com/gohugoio/hugo/resources/page\"\n\t\"github.com/gohugoio/hugo/resources/resource\"\n)\n\nvar paginatorNotSupported = page.PaginatorNotSupportedFunc(func() error {\n\treturn fmt.Errorf(\"pagination not supported for this page\")\n})\n\nfunc newPageOutput(\n\tps *pageState,\n\tpp pagePaths,\n\tf output.Format,\n\trender bool,\n) *pageOutput {\n\tvar targetPathsProvider targetPathsHolder\n\tvar linksProvider resource.ResourceLinksProvider\n\n\tft, found := pp.targetPaths[f.Name]\n\tif !found {\n\t\t// Link to the main output format\n\t\tft = pp.targetPaths[pp.firstOutputFormat.Format.Name]\n\t}\n\ttargetPathsProvider = ft\n\tlinksProvider = ft","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/hugolib/page__output.go#L10-L46","documentation":"Returned by the paginatorNotSupported stub installed at page__output.go:27-29 whenever a pageOutput is created for a non-branch page (render=false or the page is not a branch bundle). Only branch pages — home, section, taxonomy, term — get a real pagePaginator; everything else gets this stub, so calling .Paginate / .Paginator on it fails.","triggerScenarios":"A template calls `.Paginate` (or accesses `.Paginator`) on a regular/leaf page, a 404 page, or any output that was not marked for rendering; using a list partial on a single page; calling Paginate inside a shortcode rendered on a leaf bundle.","commonSituations":"Reusing a list-section layout on a single page; headless/standalone output formats; calling Paginate in a baseof or header partial included by a regular page.","solutions":["Move the .Paginate call into a branch-page template (list.html / section / home / taxonomy).","Guard the call: only invoke `.Paginate` when `.IsSection` or `eq .Kind \"section\"` (or the relevant branch kind).","Ensure the page is a branch bundle (_index.md) rather than a leaf bundle (index.md) if it should paginate children."],"exampleFix":"{{/* before: called on every page, including regular pages */}}\n{{ $pages := .Paginate .Pages }}\n\n{{/* after: only branch pages */}}\n{{ if .IsSection }}\n  {{ $pages := .Paginate .Pages }}\n{{ end }}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"{{/* Only call .Paginate on branch pages */}}\n{{- define \"maybe-paginate\" -}}\n  {{- if or (eq .Kind \"home\") (eq .Kind \"section\") (eq .Kind \"taxonomy\") (eq .Kind \"term\") -}}\n    {{- .Paginate .Pages -}}\n  {{- end -}}\n{{- end -}}","tryCatchPattern":null,"preventionTips":["Centralize pagination in a partial that checks `.IsSection`/Kind before calling .Paginate.","Reserve list.html / section layouts for branch bundles (_index.md).","Never call .Paginate inside single-page or shortcode templates."],"tags":["pagination","templates","page-kinds"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}