mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 05:30:54 +03:00
Add ContentTypes to config
This is an empty struct for now, but we will most likely expand on that. ``` [contentTypes] [contentTypes.'text/markdown'] ``` The above means that only Markdown will be considered a content type. E.g. HTML will be treated as plain text. Fixes #12274
This commit is contained in:
parent
4245a4514d
commit
c2fb221209
12 changed files with 182 additions and 52 deletions
|
@ -14,7 +14,7 @@
|
|||
package reflect
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"github.com/gohugoio/hugo/common/hreflect"
|
||||
)
|
||||
|
||||
// New returns a new instance of the reflect-namespaced template functions.
|
||||
|
@ -27,10 +27,10 @@ type Namespace struct{}
|
|||
|
||||
// IsMap reports whether v is a map.
|
||||
func (ns *Namespace) IsMap(v any) bool {
|
||||
return reflect.ValueOf(v).Kind() == reflect.Map
|
||||
return hreflect.IsMap(v)
|
||||
}
|
||||
|
||||
// IsSlice reports whether v is a slice.
|
||||
func (ns *Namespace) IsSlice(v any) bool {
|
||||
return reflect.ValueOf(v).Kind() == reflect.Slice
|
||||
return hreflect.IsSlice(v)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue