mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-14 20:37:55 -05:00
parent
e8cc785a58
commit
a118cb4138
2 changed files with 14 additions and 1 deletions
|
@ -39,3 +39,16 @@ func TestRobotsTXTOutput(t *testing.T) {
|
|||
|
||||
b.AssertFileContent("public/robots.txt", "User-agent: Googlebot")
|
||||
}
|
||||
|
||||
func TestRobotsTXTDefaultTemplate(t *testing.T) {
|
||||
t.Parallel()
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
baseURL = "http://auth/bub/"
|
||||
enableRobotsTXT = true
|
||||
`
|
||||
|
||||
b := Test(t, files)
|
||||
|
||||
b.AssertFileContent("public/robots.txt", "User-agent: *")
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ func resolvePageTemplate(d LayoutDescriptor) []string {
|
|||
}
|
||||
|
||||
switch d.Kind {
|
||||
case "robotsTXT":
|
||||
case "robotstxt":
|
||||
layouts = append(layouts, "_internal/_default/robots.txt")
|
||||
case "sitemap":
|
||||
layouts = append(layouts, "_internal/_default/sitemap.xml")
|
||||
|
|
Loading…
Reference in a new issue