mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
d44d3ea898
commit
4c560020bc
2 changed files with 8 additions and 0 deletions
|
@ -356,6 +356,11 @@ CSV2: {{ $csv2 }}
|
|||
`CSV2: [[a b c]]`,
|
||||
)
|
||||
}},
|
||||
{"resources.Get", func() bool { return true }, func(b *sitesBuilder) {
|
||||
b.WithTemplates("home.html", `NOT FOUND: {{ if (resources.Get "this-does-not-exist") }}FAILED{{ else }}OK{{ end }}`)
|
||||
}, func(b *sitesBuilder) {
|
||||
b.AssertFileContent("public/index.html", "NOT FOUND: OK")
|
||||
}},
|
||||
|
||||
{"template", func() bool { return true }, func(b *sitesBuilder) {}, func(b *sitesBuilder) {
|
||||
}},
|
||||
|
|
|
@ -200,6 +200,9 @@ func (r *Spec) newResource(sourceFs afero.Fs, fd ResourceSourceDescriptor) (reso
|
|||
var err error
|
||||
fi, err = sourceFs.Stat(fd.SourceFilename)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
sourceFilename = fd.SourceFilename
|
||||
|
|
Loading…
Reference in a new issue