tpl/os: Make it a package that stands on its own

See #3042
This commit is contained in:
Bjørn Erik Pedersen
2017-04-30 22:52:47 +02:00
parent fc77b6303c
commit b958c0c109
4 changed files with 50 additions and 12 deletions

View File

@@ -69,7 +69,9 @@ func TestTemplateFuncsExamples(t *testing.T) {
afero.WriteFile(fs.Source, filepath.Join(workingDir, "README.txt"), []byte("Hugo Rocks!"), 0755)
d, err := deps.New(newDepsConfig(v))
depsCfg := newDepsConfig(v)
depsCfg.Fs = fs
d, err := deps.New(depsCfg)
require.NoError(t, err)
var data struct {
@@ -139,8 +141,6 @@ print: {{ print "works!" }}
printf: {{ printf "%s!" "works" }}
println: {{ println "works!" -}}
plainify: {{ plainify "Hello <strong>world</strong>, gophers!" }}
readDir: {{ range (readDir ".") }}{{ .Name }}{{ end }}
readFile: {{ readFile "README.txt" }}
relLangURL: {{ "index.html" | relLangURL }}
relURL 1: {{ "http://gohugo.io/" | relURL }}
relURL 2: {{ "mystyle.css" | relURL }}
@@ -174,8 +174,6 @@ print: works!
printf: works!
println: works!
plainify: Hello world, gophers!
readDir: README.txt
readFile: Hugo Rocks!
relLangURL: /hugo/en/index.html
relURL 1: http://gohugo.io/
relURL 2: /hugo/mystyle.css