mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
4dae52af68
commit
bceda1b288
1 changed files with 14 additions and 0 deletions
|
@ -1174,6 +1174,20 @@ func TestPageWithZeroFile(t *testing.T) {
|
|||
WithTemplatesAdded("index.html", "{{ .File.Filename }}{{ with .File }}{{ .Dir }}{{ end }}").Build(BuildCfg{})
|
||||
}
|
||||
|
||||
func TestHomePageWithNoTitle(t *testing.T) {
|
||||
b := newTestSitesBuilder(t).WithSimpleConfigFile().
|
||||
WithTemplatesAdded("index.html", "Title|{{ with .Title }}{{ . }}{{ end }}|")
|
||||
b.WithContent("_index.md", `---
|
||||
description: "No title for you!"
|
||||
---
|
||||
|
||||
Content.
|
||||
`)
|
||||
|
||||
b.Build(BuildCfg{})
|
||||
b.AssertFileContent("public/index.html", "Title||")
|
||||
}
|
||||
|
||||
func TestShouldBuild(t *testing.T) {
|
||||
t.Parallel()
|
||||
var past = time.Date(2009, 11, 17, 20, 34, 58, 651387237, time.UTC)
|
||||
|
|
Loading…
Reference in a new issue