diff --git a/hugolib/robotstxt_test.go b/hugolib/robotstxt_test.go index 2035c235f..c901ce662 100644 --- a/hugolib/robotstxt_test.go +++ b/hugolib/robotstxt_test.go @@ -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: *") +} diff --git a/output/layouts/layout.go b/output/layouts/layout.go index c05841ae3..b903e09ea 100644 --- a/output/layouts/layout.go +++ b/output/layouts/layout.go @@ -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")