Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output format parameter ignored if RSS template file name excludes output format identifier #12992

Open
jmooring opened this issue Oct 29, 2024 · 2 comments
Labels
Milestone

Comments

@jmooring
Copy link
Member

jmooring commented Oct 29, 2024

hugo.toml
[outputFormats.rss]
isPlainText = true
layouts/_default/list.xml
{{ $s := "<hr>" }}
{{ $s }}
public/index.xml (expected)
<hr>
public/index.xml (actual)
&lt;hr&gt;

If I include the output format identifier in the template file name (e.g., layouts/_default/list.rss.xml) I get the expected result.

This may be unique to the isPlainText parameter, or it may affect all output format parameters... not sure.

I'm pretty sure this is unique to the rss output format.

integration test
func TestFoo(t *testing.T) {
	t.Parallel()

	files := `
-- hugo.toml --
## disableKinds = ['page','home','section','sitemap','taxonomy','term']
[outputFormats.rss]
isPlainText = true
[outputs]
home = ['rss']
-- layouts/_default/list.rss.xml --
{{ $s := "<hr>" }}
{{ $s }}
`

	b := hugolib.Test(t, files)
	b.AssertFileContent("public/index.xml", "<hr>")

	files = strings.ReplaceAll(files, "layouts/_default/list.rss.xml", "layouts/_default/list.xml")

	b = hugolib.Test(t, files)
	b.AssertFileContent("public/index.xml", "<hr>") // failing test
}
@bep bep removed the NeedsTriage label Oct 29, 2024
@bep bep added this to the v0.138.0 milestone Oct 29, 2024
@bep
Copy link
Member

bep commented Oct 29, 2024

I'm pretty sure this is unique to the rss output format.

I suspect this comes from some history about being backward compatible with rss being both a page kind and a output format.

@jmooring
Copy link
Member Author

Understood. This is obviously not a high priority item. I just wanted to make sure we were tracking it somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants