mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
Revert "tpl: Rework to handle both text and HTML templates"
Will have to take another stab at this ...
This reverts commit 5c5efa03d2
.
Closes #3260
This commit is contained in:
@@ -115,13 +115,13 @@ F3: {{ Echo (printf "themes/%s-theme" .Site.Params.LOWER) }}
|
||||
func TestParamsKeysToLower(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
require.Error(t, applyTemplateTransformers(nil, nil))
|
||||
require.Error(t, applyTemplateTransformers(nil))
|
||||
|
||||
templ, err := template.New("foo").Funcs(testFuncs).Parse(paramsTempl)
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
c := newTemplateContext(createParseTreeLookup(templ))
|
||||
c := newTemplateContext(templ)
|
||||
|
||||
require.Equal(t, -1, c.decl.indexOfReplacementStart([]string{}))
|
||||
|
||||
@@ -185,7 +185,7 @@ func BenchmarkTemplateParamsKeysToLower(b *testing.B) {
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
c := newTemplateContext(createParseTreeLookup(templates[i]))
|
||||
c := newTemplateContext(templates[i])
|
||||
c.paramsKeysToLower(templ.Tree.Root)
|
||||
}
|
||||
}
|
||||
@@ -214,7 +214,7 @@ Blue: {{ $__amber_1.Blue}}
|
||||
|
||||
require.NoError(t, err)
|
||||
|
||||
c := newTemplateContext(createParseTreeLookup(templ))
|
||||
c := newTemplateContext(templ)
|
||||
|
||||
c.paramsKeysToLower(templ.Tree.Root)
|
||||
|
||||
@@ -254,7 +254,7 @@ P2: {{ .Params.LOWER }}
|
||||
require.NoError(t, err)
|
||||
overlayTpl = overlayTpl.Lookup(overlayTpl.Name())
|
||||
|
||||
c := newTemplateContext(createParseTreeLookup(overlayTpl))
|
||||
c := newTemplateContext(overlayTpl)
|
||||
|
||||
c.paramsKeysToLower(overlayTpl.Tree.Root)
|
||||
|
||||
@@ -284,7 +284,7 @@ func TestTransformRecursiveTemplate(t *testing.T) {
|
||||
templ, err := template.New("foo").Parse(recursive)
|
||||
require.NoError(t, err)
|
||||
|
||||
c := newTemplateContext(createParseTreeLookup(templ))
|
||||
c := newTemplateContext(templ)
|
||||
c.paramsKeysToLower(templ.Tree.Root)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user