gohugoio/hugo · error
permalinks configuration not supported for kind
Error message
permalinks configuration not supported for kind %q, supported kinds are %v
What it means
Thrown by decodePermalinksMap when the legacy map-format permalinks config uses a '[permalinks.<kind>]' sub-section whose <kind> key is not one of the supported page kinds (page, home, section, taxonomy, term). The message lists the allowed kinds.
Solutions
- Use only supported kinds as the sub-section key: page, home, section, taxonomy, or term.
- If you meant to target a section, put the section under the top-level [permalinks] map (posts = "/:slug/") instead of [permalinks.posts].
- Switch to the list format with explicit target.kind/target.path for finer control.
Example fix
# before (invalid) [permalinks.archive] posts = "/:year/:slug/" # after [permalinks] posts = "/:year/:slug/"
Defensive patterns
Strategy: validation
Validate before calling
supported := map[string]bool{"page": true, "home": true, "section": true, "taxonomy": true, "term": true}
for k := range m {
if _, isParams := m[k].(hmaps.Params); isParams && !supported[k] {
return fmt.Errorf("kind %q not supported", k)
}
} Type guard
func isSupportedPermalinkKind(k string) bool {
for _, s := range []string{"page", "home", "section", "taxonomy", "term"} {
if s == k { return true }
}
return false
} Try / catch
cfg, err := page.DecodePermalinksConfig(raw)
if err != nil { /* move section keys to top-level [permalinks] */ } Prevention
- Use only page/home/section/taxonomy/term as per-kind permalink sub-section keys.
- Put section targeting under the top-level [permalinks] map instead.
- Prefer the list format with explicit target.kind for clarity.
When it happens
Trigger: Writing [permalinks.archive] or [permalinks.custom] (a kind Hugo does not support) under the map format, expecting section-style keys but using an invalid kind identifier.
Common situations: Confusing the section-name map format ([permalinks] / posts = ...) with the per-kind map format ([permalinks.<kind>] / ... = ...) and putting an arbitrary string as the kind.
Related errors
- permalink attribute not recognised
- permalinks: missing pattern
- cardinalityThreshold threshold must be between 0 and 100
- failed to compile permalink target
- markup must not be set, use mediaType
AI-assisted analysis of gohugoio/hugo@52c9bd7908 (2026-08-09).
Data as JSON: /api/errors/f0544cf9cb5e2407.
Report an issue: GitHub.
Appendix: source
Thrown at resources/page/permalinks.go:583
var configs PermalinksConfig
config := hmaps.CleanConfigStringMap(m)
for k, v := range config {
switch v := v.(type) {
case string:
// [permalinks]
// key = '...'
// Backward compat: set for both page and term.
configs = append(configs,
PermalinkConfig{Target: PageMatcher{Kind: kinds.KindPage, Path: sectionToPathGlob(k)}, Pattern: v},
PermalinkConfig{Target: PageMatcher{Kind: kinds.KindTerm, Path: sectionToPathGlob(k)}, Pattern: v},
)
case hmaps.Params:
// [permalinks.kind]
// section = '...'
if !hstrings.InSlice(permalinksKindsSupport, k) {
return nil, fmt.Errorf("permalinks configuration not supported for kind %q, supported kinds are %v", k, permalinksKindsSupport)
}
for k2, v2 := range v {
switch v2 := v2.(type) {
case string:
configs = append(configs,
PermalinkConfig{Target: PageMatcher{Kind: k, Path: sectionToPathGlob(k2)}, Pattern: v2},
)
default:
return nil, fmt.Errorf("permalinks configuration invalid: unknown value %q for key %q for kind %q", v2, k2, k)
}
}
default:
return nil, fmt.Errorf("permalinks configuration invalid: unknown value %q for key %q", v, k)
}
}
return configs, nil
}View on GitHub (pinned to 52c9bd7908)