summaryrefslogtreecommitdiffstats
path: root/hugolib/site_output_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/site_output_test.go')
-rw-r--r--hugolib/site_output_test.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/hugolib/site_output_test.go b/hugolib/site_output_test.go
index a68555574..3d95709c5 100644
--- a/hugolib/site_output_test.go
+++ b/hugolib/site_output_test.go
@@ -646,3 +646,40 @@ WordCount: {{ .WordCount }}
b.AssertFileContent("public/outputs-empty/index.html", "HTML:", "Word1. Word2.")
b.AssertFileContent("public/outputs-string/index.html", "O1:", "Word1. Word2.")
}
+
+func TestOuputFormatFrontMatterTermIssue12275(t *testing.T) {
+ t.Parallel()
+
+ files := `
+-- hugo.toml --
+disableKinds = ['home','page','rss','section','sitemap','taxonomy']
+-- content/p1.md --
+---
+title: p1
+tags:
+ - tag-a
+ - tag-b
+---
+-- content/tags/tag-a/_index.md --
+---
+title: tag-a
+outputs:
+ - html
+ - json
+---
+-- content/tags/tag-b/_index.md --
+---
+title: tag-b
+---
+-- layouts/_default/term.html --
+{{ .Title }}
+-- layouts/_default/term.json --
+{{ jsonify (dict "title" .Title) }}
+`
+
+ b := Test(t, files)
+
+ b.AssertFileContent("public/tags/tag-a/index.html", "tag-a")
+ b.AssertFileContent("public/tags/tag-b/index.html", "tag-b")
+ b.AssertFileContent("public/tags/tag-a/index.json", `{"title":"tag-a"}`) // failing test
+}