aboutsummaryrefslogtreecommitdiffhomepage
path: root/parser
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2018-12-23 21:34:17 +0100
committerBjørn Erik Pedersen <[email protected]>2018-12-23 21:34:17 +0100
commitbe58c7b9c88116094ca2b424c77210ddcccfff8e (patch)
treec501853a3e23f79d5d11c9114ed48149838232ce /parser
parent62d031aedfc128729b460241bd99d97b5d902e62 (diff)
downloadhugo-be58c7b9c88116094ca2b424c77210ddcccfff8e.tar.gz
hugo-be58c7b9c88116094ca2b424c77210ddcccfff8e.zip
tpl/transform: Include options in cache key
See #5555
Diffstat (limited to 'parser')
-rw-r--r--parser/metadecoders/decoder.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/parser/metadecoders/decoder.go b/parser/metadecoders/decoder.go
index 2f3c27d45..b2d8307b6 100644
--- a/parser/metadecoders/decoder.go
+++ b/parser/metadecoders/decoder.go
@@ -18,6 +18,7 @@ import (
"encoding/csv"
"encoding/json"
"fmt"
+ "strings"
"github.com/gohugoio/hugo/common/herrors"
@@ -39,6 +40,14 @@ type Decoder struct {
Comment rune
}
+// OptionsKey is used in cache keys.
+func (d Decoder) OptionsKey() string {
+ var sb strings.Builder
+ sb.WriteRune(d.Delimiter)
+ sb.WriteRune(d.Comment)
+ return sb.String()
+}
+
// Default is a Decoder in its default configuration.
var Default = Decoder{
Delimiter: ',',