Repository: gohugoio/hugo (language: go)

Issue:
My robots.txt file disappeared when I moved to 0.123.0
I just cut over from 0.122.0 to 0.123.0 (https://github.com/simonhollingshead/simonhollingshead.com/commit/457da72f16bccf8a9df03671412a63fbda4809d4).  I made no other changes.

I have always had enableRobotsTXT enabled.  https://github.com/simonhollingshead/simonhollingshead.com/blob/main/hugo.toml#L6

The template is not being overwritten at either of the two lookup paths - neither exist (/layouts/robots.txt, /themes/`<THEME>`/layouts/robots.txt) but even if it was I would expect an empty or otherwise changed file, not a lack of a file.

https://github.com/simonhollingshead/simonhollingshead.com/commit/bc822a0f6f2cb1aea65efeb603eb1dd0b7d280fb - a github action writes the files back for me.  You can see the expected mutations of the change of version in the meta tag, a completely acceptable change where the sitemap now actually generates a modified date for the homepage where it didn't before, but also the removal of the robots.txt file.

I saw no breaking change or description in the release notes that any changes were being made to the robots.txt generation.

### What version of Hugo are you using (`hugo version`)? 0.123.0
### Does this issue reproduce with the latest release? This is the latest.



Discussion / hints:
Confirmed. We're not generating a robots.txt file when `enableRobotsTxt` is `true` in site configuration.
I will fix this. I see that the only test we have for this is with a custom robotstxt template (which I then assume work), but not a test for the built-in template.

Fix patch:
diff --git a/output/layouts/layout.go b/output/layouts/layout.go
index c05841ae333..b903e09eaed 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")


Test patch:
diff --git a/hugolib/robotstxt_test.go b/hugolib/robotstxt_test.go
index 2035c235ff6..c901ce6629b 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: *")
+}