mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
hugolib: Fix output format handling of mix cased page kinds
Fixes #4528
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
package hugolib
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/gohugoio/hugo/resources/page"
|
||||
)
|
||||
|
||||
@@ -38,3 +40,17 @@ const (
|
||||
|
||||
pageResourceType = "page"
|
||||
)
|
||||
|
||||
var kindMap = map[string]string{
|
||||
strings.ToLower(kindRSS): kindRSS,
|
||||
strings.ToLower(kindSitemap): kindSitemap,
|
||||
strings.ToLower(kindRobotsTXT): kindRobotsTXT,
|
||||
strings.ToLower(kind404): kind404,
|
||||
}
|
||||
|
||||
func getKind(s string) string {
|
||||
if pkind := page.GetKind(s); pkind != "" {
|
||||
return pkind
|
||||
}
|
||||
return kindMap[strings.ToLower(s)]
|
||||
}
|
||||
|
Reference in New Issue
Block a user