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

Front matter output formats ignored for term page #12275

Closed
jmooring opened this issue Mar 19, 2024 · 1 comment · Fixed by #12280
Closed

Front matter output formats ignored for term page #12275

jmooring opened this issue Mar 19, 2024 · 1 comment · Fixed by #12280

Comments

@jmooring
Copy link
Member

This worked with v0.122.0.

Reference: https://discourse.gohugo.io/t/per-page-output-format-setting-for-a-taxonomy-term-isnt-considered/48911

Failing test:

func TestFoo(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 := hugolib.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
}
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants