mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-09 19:47:02 +02:00
transform: Add support for "format" option in transform.Unmarshal
Fixes #13887
This commit is contained in:
@@ -36,6 +36,10 @@ import (
|
||||
|
||||
// Decoder provides some configuration options for the decoders.
|
||||
type Decoder struct {
|
||||
// Format specifies a specific format to decode from. If empty or
|
||||
// unspecified, it's inferred from the contents or the filename.
|
||||
Format string
|
||||
|
||||
// Delimiter is the field delimiter. Used in the CSV decoder. Default is
|
||||
// ','.
|
||||
Delimiter rune
|
||||
@@ -57,6 +61,7 @@ type Decoder struct {
|
||||
// OptionsKey is used in cache keys.
|
||||
func (d Decoder) OptionsKey() string {
|
||||
var sb strings.Builder
|
||||
sb.WriteString(d.Format)
|
||||
sb.WriteRune(d.Delimiter)
|
||||
sb.WriteRune(d.Comment)
|
||||
sb.WriteString(strconv.FormatBool(d.LazyQuotes))
|
||||
|
Reference in New Issue
Block a user