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

Drafts do not remove content from home / nav #356

Open
dmadison opened this issue Feb 5, 2023 · 2 comments
Open

Drafts do not remove content from home / nav #356

dmadison opened this issue Feb 5, 2023 · 2 comments

Comments

@dmadison
Copy link
Contributor

dmadison commented Feb 5, 2023

Describe the bug
Setting draft: true on any home sections (e.g. home/about.md, home/contact.md, etc.) will remove the content from the page but not the section itself or its entry in the nav.

To Reproduce
Set the front matter 'draft' value of any home section markdown file to 'true'.

Expected behavior
Setting a page to 'draft' should remove both the section and the nav entry from the site.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome
  • Version: 109.0.5414.120

Additional context
I'm new to Hugo, so it is entirely possible that I am misunderstanding the purpose of the 'draft' parameter!

@github-actions
Copy link

It looks like this has been idle a while, so I am marking it as stale. Remove the label or comment if this issue should remain open.

@victoriadrake
Copy link
Owner

I think this is a valid bug. It seems the GetPage function doesn’t account for the page at the given path being in draft status, so the logic that controls whether these sections on the home page are shown isn’t correctly executed.

{{ with .Site.GetPage "/home" }}

Same for GetMatch:

{{ with .Resources.GetMatch "contact.md" }}

It appears the current behavior goes against user expectations. We should find another option for the logic to display these sections that respects draft status.

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

No branches or pull requests

2 participants