gohugoio/hugo · error

pagination not supported for this page

Error message

pagination not supported for this page

What it means

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.

Solutions

  1. Move the .Paginate call into a branch-page template (list.html / section / home / taxonomy).
  2. Guard the call: only invoke `.Paginate` when `.IsSection` or `eq .Kind "section"` (or the relevant branch kind).
  3. Ensure the page is a branch bundle (_index.md) rather than a leaf bundle (index.md) if it should paginate children.

Example fix

{{/* before: called on every page, including regular pages */}}
{{ $pages := .Paginate .Pages }}

{{/* after: only branch pages */}}
{{ if .IsSection }}
  {{ $pages := .Paginate .Pages }}
{{ end }}
Defensive patterns

Strategy: type-guard

Type guard

{{/* Only call .Paginate on branch pages */}}
{{- define "maybe-paginate" -}}
  {{- if or (eq .Kind "home") (eq .Kind "section") (eq .Kind "taxonomy") (eq .Kind "term") -}}
    {{- .Paginate .Pages -}}
  {{- end -}}
{{- end -}}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of gohugoio/hugo@52c9bd7908 (2026-08-09). Data as JSON: /api/errors/887557f00187e549. Report an issue: GitHub.

Appendix: source

Thrown at hugolib/page__output.go:28

// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package hugolib

import (
	"fmt"
	"path"
	"strings"

	"github.com/gohugoio/hugo/identity"
	"github.com/gohugoio/hugo/output"
	"github.com/gohugoio/hugo/resources/page"
	"github.com/gohugoio/hugo/resources/resource"
)

var paginatorNotSupported = page.PaginatorNotSupportedFunc(func() error {
	return fmt.Errorf("pagination not supported for this page")
})

func newPageOutput(
	ps *pageState,
	pp pagePaths,
	f output.Format,
	render bool,
) *pageOutput {
	var targetPathsProvider targetPathsHolder
	var linksProvider resource.ResourceLinksProvider

	ft, found := pp.targetPaths[f.Name]
	if !found {
		// Link to the main output format
		ft = pp.targetPaths[pp.firstOutputFormat.Format.Name]
	}
	targetPathsProvider = ft
	linksProvider = ft

View on GitHub (pinned to 52c9bd7908)