mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-14 07:07:33 -04:00
parent
b39b249623
commit
80f0595311
@ -299,3 +299,19 @@ P2.
|
|||||||
b := hugolib.Test(t, files)
|
b := hugolib.Test(t, files)
|
||||||
b.AssertFileContent("public/index.html", "P1: P1.\nP2: foo bar")
|
b.AssertFileContent("public/index.html", "P1: P1.\nP2: foo bar")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTemplateExistsCaseIssue13684(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
|
files := `
|
||||||
|
-- hugo.toml --
|
||||||
|
-- layouts/home.html --
|
||||||
|
P1: {{ templates.Exists "_partials/MyPartial.html" }}|P1: {{ templates.Exists "_partials/mypartial.html" }}|
|
||||||
|
-- layouts/_partials/MyPartial.html --
|
||||||
|
MyPartial.
|
||||||
|
|
||||||
|
`
|
||||||
|
|
||||||
|
b := hugolib.Test(t, files)
|
||||||
|
b.AssertFileContent("public/index.html", "P1: true|P1: true|")
|
||||||
|
}
|
||||||
|
@ -712,6 +712,7 @@ func (s *TemplateStore) RefreshFiles(include func(fi hugofs.FileMetaInfo) bool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *TemplateStore) HasTemplate(templatePath string) bool {
|
func (s *TemplateStore) HasTemplate(templatePath string) bool {
|
||||||
|
templatePath = strings.ToLower(templatePath)
|
||||||
templatePath = paths.AddLeadingSlash(templatePath)
|
templatePath = paths.AddLeadingSlash(templatePath)
|
||||||
return s.templatesByPath.Contains(templatePath)
|
return s.templatesByPath.Contains(templatePath)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user