mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-19 21:21:39 +02:00
@@ -779,3 +779,45 @@ Single.
|
||||
|
||||
b.AssertFileContent("public/tags/index.html", "Terms: mytag: 1|§s")
|
||||
}
|
||||
|
||||
func TestContentAdapterOutputsIssue13689(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
files := `
|
||||
-- hugo.toml --
|
||||
disableKinds = ['home','rss','section','sitemap','taxonomy','term']
|
||||
[outputs]
|
||||
page = ['html','json']
|
||||
-- layouts/page.html --
|
||||
html: {{ .Title }}
|
||||
-- layouts/page.json --
|
||||
json: {{ .Title }}
|
||||
-- content/p1.md --
|
||||
---
|
||||
title: p1
|
||||
---
|
||||
-- content/p2.md --
|
||||
---
|
||||
title: p2
|
||||
outputs:
|
||||
- html
|
||||
---
|
||||
-- content/_content.gotmpl --
|
||||
{{ $page := dict "path" "p3" "title" "p3" }}
|
||||
{{ $.AddPage $page }}
|
||||
|
||||
{{ $page := dict "path" "p4" "title" "p4" "outputs" (slice "html") }}
|
||||
{{ $.AddPage $page }}
|
||||
`
|
||||
|
||||
b := hugolib.Test(t, files)
|
||||
|
||||
b.AssertFileExists("public/p1/index.html", true)
|
||||
b.AssertFileExists("public/p1/index.json", true)
|
||||
b.AssertFileExists("public/p2/index.html", true)
|
||||
b.AssertFileExists("public/p2/index.json", false)
|
||||
b.AssertFileExists("public/p3/index.html", true)
|
||||
b.AssertFileExists("public/p3/index.json", true)
|
||||
b.AssertFileExists("public/p4/index.html", true)
|
||||
b.AssertFileExists("public/p4/index.json", false) // currently returns true
|
||||
}
|
||||
|
Reference in New Issue
Block a user