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

Draft term pages not handled correctly #12055

Closed
jmooring opened this issue Feb 17, 2024 · 4 comments · Fixed by #12056
Closed

Draft term pages not handled correctly #12055

jmooring opened this issue Feb 17, 2024 · 4 comments · Fixed by #12056

Comments

@jmooring
Copy link
Member

jmooring commented Feb 17, 2024

hugo v0.123.0-DEV-9cc65757a

This test fails:

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

	files := `
-- layouts/_default/list.html --
|{{ .Title }}|
-- content/p1.md --
---
title: p1
tags: [a]
---
-- content/tags/a/_index.md --
---
title: tag-a-title-override
draft: true
---
  `

	b := hugolib.Test(t, files)

	b.AssertFileContent("public/tags/a/index.html", "|a|")
}

Want:

|a|

Got:

|tag-a-title-override|
@jmooring
Copy link
Member Author

I'm waiting on some new eye glasses. Just made a couple of edits to the above.

@jmooring
Copy link
Member Author

jmooring commented Feb 17, 2024

Although the page title rendered above looks wrong to me, I have also lost/forgotten whether we should render the term page at all. Per this discussion, it seems like we should not render the term page if draft is true, but things may have changed since then.

@bep
Copy link
Member

bep commented Feb 17, 2024

Per #11809 (comment), it seems like we should not render the term page if draft is true, but things may have changed since then.

  • For the other branch nodes, we just disable them so they don't get rendered/listed but keep them to preserve structure.
  • Looking at the code, I see that my idea was to just to remove these nodes (which I think makes sense).

bep added a commit that referenced this issue Feb 17, 2024
By just removing the term page and all of its page entries.

Fixes #12055
@bep bep changed the title Title from term's _index.md used when page is draft Draft term pages not handled correctly Feb 17, 2024
@bep bep removed the NeedsTriage label Feb 17, 2024
@bep bep added this to the v0.123.0 milestone Feb 17, 2024
bep added a commit that referenced this issue Feb 17, 2024
By just removing the term page and all of its page entries.

Fixes #12055
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 Mar 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