{"record":{"id":"c75c9f5cc48d4744","repo":"gohugoio/hugo","slug":"q-did-not-match-a-valid-page-kind","errorCode":null,"errorMessage":"%q did not match a valid Page Kind","messagePattern":"%q did not match a valid Page Kind","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"resources/page/page_matcher.go","lineNumber":244,"sourceCode":"\t\tdefault:\n\t\t\tpcfg.Fields[k] = v\n\t\t}\n\t}\n\treturn pcfg, pcfg.init()\n}\n\n// decodePageMatcher decodes m into v.\nfunc (d cascadeConfigDecoder) decodePageMatcher(m any, v *PageMatcher) error {\n\tif err := mapstructure.WeakDecode(m, v); err != nil {\n\t\treturn err\n\t}\n\n\tv.Kind = strings.ToLower(v.Kind)\n\tif v.Kind != \"\" {\n\t\tg, _ := hglob.GetGlob(v.Kind)\n\t\tfound := slices.ContainsFunc(kinds.AllKindsInPages, g.Match)\n\t\tif !found {\n\t\t\treturn fmt.Errorf(\"%q did not match a valid Page Kind\", v.Kind)\n\t\t}\n\t}\n\n\tv.Path = filepath.ToSlash(strings.ToLower(v.Path))\n\n\tif v.Lang != \"\" {\n\t\tv.Sites.Matrix.Languages = append(v.Sites.Matrix.Languages, v.Lang)\n\t\tv.Sites.Matrix.Languages = hstrings.UniqueStringsReuse(v.Sites.Matrix.Languages)\n\t}\n\n\treturn nil\n}\n\nfunc (v *PageMatcher) compileGlobs() error {\n\tvar err error\n\tif v.Kind != \"\" {\n\t\tv.kindGlob, err = hglob.GetGlob(v.Kind)\n\t\tif err != nil {","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/resources/page/page_matcher.go#L226-L262","documentation":"Returned by decodePageMatcher when the Kind field (after lowercasing) does not match any valid Hugo Page Kind via glob matching against kinds.AllKindsInPages. Hugo supports glob patterns in the Kind field, so 'page' matches, 'sec*' matches 'section', but 'article' (not a Hugo kind) does not match anything.","triggerScenarios":"Setting target.kind in a cascade to a string that is not a valid Page Kind or glob matching one. Valid kinds include: home, page, section, taxonomy, term, and their combinations. The value is lowercased and compiled as a glob before matching.","commonSituations":"Using 'article' instead of 'page' (common for users coming from other CMSs); using 'category' instead of 'taxonomy' or 'term'; typo like 'pagge'; using a singular when Hugo expects plural ('section' not 'sections').","solutions":["Check the error message for the invalid kind value, then use a valid Hugo Page Kind: home, page, section, taxonomy, or term.","Use a glob pattern if you want to match multiple kinds, e.g. '{page,section}' or '*'.","Omit the kind field entirely to match all kinds."],"exampleFix":"# before\ncascade:\n  - _target:\n      kind: \"article\"\n    params:\n      toc: true\n\n# after\ncascade:\n  - _target:\n      kind: \"page\"\n    params:\n      toc: true","handlingStrategy":"validation","validationCode":"// Validate a cascade target kind before decoding\nfunc validatePageKind(kind string) error {\n    kind = strings.ToLower(kind)\n    if kind == \"\" { return nil }\n    g, err := hglob.GetGlob(kind)\n    if err != nil { return err }\n    found := slices.ContainsFunc(kinds.AllKindsInPages, g.Match)\n    if !found {\n        return fmt.Errorf(\"kind %q did not match a valid Page Kind\", kind)\n    }\n    return nil\n}\n\n// Valid Hugo page kinds: home, page, section, taxonomy, term","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Valid Hugo page kinds are: home, page, section, taxonomy, term.","Use glob patterns to match multiple kinds, e.g. '{page,section}' or '*'.","If coming from another CMS, map your content types to Hugo kinds: 'article' → 'page', 'category list' → 'taxonomy', 'category entry' → 'term'."],"tags":["hugo","cascade","page-kind","front-matter","config-validation"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}