diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-12-10 08:02:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-12-12 09:59:34 +0100 |
commit | 167c01530bb295c8b8d35921eb27ffa5bee76dfe (patch) | |
tree | 338ba8c18bf8533bb0fec5506a12e78b656d6723 /hugolib | |
parent | 4c804319f6db0b8459cc9b5df4a904fd2c55dedd (diff) |
Create lightweight forks of text/template and html/template
This commit also removes support for Ace and Amber templates.
Updates #6594
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/case_insensitive_test.go | 16 | ||||
-rw-r--r-- | hugolib/template_engines_test.go | 18 |
2 files changed, 6 insertions, 28 deletions
diff --git a/hugolib/case_insensitive_test.go b/hugolib/case_insensitive_test.go index 4a6b8f3a0..a8616ab06 100644 --- a/hugolib/case_insensitive_test.go +++ b/hugolib/case_insensitive_test.go @@ -16,7 +16,6 @@ package hugolib import ( "fmt" "path/filepath" - "strings" "testing" "github.com/gohugoio/hugo/hugofs" @@ -234,6 +233,7 @@ Page2: {{ $page2.Params.ColoR }} ) } +// TODO1 func TestCaseInsensitiveConfigurationForAllTemplateEngines(t *testing.T) { t.Parallel() @@ -241,23 +241,13 @@ func TestCaseInsensitiveConfigurationForAllTemplateEngines(t *testing.T) { return s } - amberFixer := func(s string) string { - fixed := strings.Replace(s, "{{ .Site.Params", "{{ Site.Params", -1) - fixed = strings.Replace(fixed, "{{ .Params", "{{ Params", -1) - fixed = strings.Replace(fixed, ".Content", "Content", -1) - fixed = strings.Replace(fixed, "{{", "#{", -1) - fixed = strings.Replace(fixed, "}}", "}", -1) - - return fixed - } - for _, config := range []struct { suffix string templateFixer func(s string) string }{ - {"amber", amberFixer}, + //{"amber", amberFixer}, {"html", noOp}, - {"ace", noOp}, + //{"ace", noOp}, } { doTestCaseInsensitiveConfigurationForTemplateEngine(t, config.suffix, config.templateFixer) diff --git a/hugolib/template_engines_test.go b/hugolib/template_engines_test.go index ebfb0b428..ea0fca0b6 100644 --- a/hugolib/template_engines_test.go +++ b/hugolib/template_engines_test.go @@ -18,34 +18,22 @@ import ( "path/filepath" "testing" - "strings" - "github.com/gohugoio/hugo/deps" ) +// TODO1 func TestAllTemplateEngines(t *testing.T) { noOp := func(s string) string { return s } - amberFixer := func(s string) string { - fixed := strings.Replace(s, "{{ .Title", "{{ Title", -1) - fixed = strings.Replace(fixed, ".Content", "Content", -1) - fixed = strings.Replace(fixed, ".IsNamedParams", "IsNamedParams", -1) - fixed = strings.Replace(fixed, "{{", "#{", -1) - fixed = strings.Replace(fixed, "}}", "}", -1) - fixed = strings.Replace(fixed, `title "hello world"`, `title("hello world")`, -1) - - return fixed - } - for _, config := range []struct { suffix string templateFixer func(s string) string }{ - {"amber", amberFixer}, + //{"amber", amberFixer}, {"html", noOp}, - {"ace", noOp}, + //{"ace", noOp}, } { config := config t.Run(config.suffix, |