{"record":{"id":"f0544cf9cb5e2407","repo":"gohugoio/hugo","slug":"permalinks-configuration-not-supported-for-kind-q","errorCode":null,"errorMessage":"permalinks configuration not supported for kind %q, supported kinds are %v","messagePattern":"permalinks configuration not supported for kind %q, supported kinds are (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"resources/page/permalinks.go","lineNumber":583,"sourceCode":"\tvar configs PermalinksConfig\n\tconfig := hmaps.CleanConfigStringMap(m)\n\n\tfor k, v := range config {\n\t\tswitch v := v.(type) {\n\t\tcase string:\n\t\t\t// [permalinks]\n\t\t\t//   key = '...'\n\t\t\t// Backward compat: set for both page and term.\n\t\t\tconfigs = append(configs,\n\t\t\t\tPermalinkConfig{Target: PageMatcher{Kind: kinds.KindPage, Path: sectionToPathGlob(k)}, Pattern: v},\n\t\t\t\tPermalinkConfig{Target: PageMatcher{Kind: kinds.KindTerm, Path: sectionToPathGlob(k)}, Pattern: v},\n\t\t\t)\n\n\t\tcase hmaps.Params:\n\t\t\t// [permalinks.kind]\n\t\t\t//   section = '...'\n\t\t\tif !hstrings.InSlice(permalinksKindsSupport, k) {\n\t\t\t\treturn nil, fmt.Errorf(\"permalinks configuration not supported for kind %q, supported kinds are %v\", k, permalinksKindsSupport)\n\t\t\t}\n\t\t\tfor k2, v2 := range v {\n\t\t\t\tswitch v2 := v2.(type) {\n\t\t\t\tcase string:\n\t\t\t\t\tconfigs = append(configs,\n\t\t\t\t\t\tPermalinkConfig{Target: PageMatcher{Kind: k, Path: sectionToPathGlob(k2)}, Pattern: v2},\n\t\t\t\t\t)\n\t\t\t\tdefault:\n\t\t\t\t\treturn nil, fmt.Errorf(\"permalinks configuration invalid: unknown value %q for key %q for kind %q\", v2, k2, k)\n\t\t\t\t}\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"permalinks configuration invalid: unknown value %q for key %q\", v, k)\n\t\t}\n\t}\n\treturn configs, nil\n}","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/resources/page/permalinks.go#L565-L601","documentation":"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.","triggerScenarios":"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.","commonSituations":"Confusing the section-name map format ([permalinks] / posts = ...) with the per-kind map format ([permalinks.<kind>] / ... = ...) and putting an arbitrary string as the kind.","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."],"exampleFix":"# before (invalid)\n[permalinks.archive]\nposts = \"/:year/:slug/\"\n# after\n[permalinks]\nposts = \"/:year/:slug/\"","handlingStrategy":"validation","validationCode":"supported := map[string]bool{\"page\": true, \"home\": true, \"section\": true, \"taxonomy\": true, \"term\": true}\nfor k := range m {\n    if _, isParams := m[k].(hmaps.Params); isParams && !supported[k] {\n        return fmt.Errorf(\"kind %q not supported\", k)\n    }\n}","typeGuard":"func isSupportedPermalinkKind(k string) bool {\n    for _, s := range []string{\"page\", \"home\", \"section\", \"taxonomy\", \"term\"} {\n        if s == k { return true }\n    }\n    return false\n}","tryCatchPattern":"cfg, err := page.DecodePermalinksConfig(raw)\nif err != nil { /* move section keys to top-level [permalinks] */ }","preventionTips":["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."],"tags":["hugo","permalinks","configuration","page-kinds","validation"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}