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

Emit a warning that can be turned off when overwriting built-in .Params values #11941

Closed
bep opened this issue Jan 30, 2024 · 1 comment
Closed
Assignees
Milestone

Comments

@bep
Copy link
Member

bep commented Jan 30, 2024

I have slept on this.

With the addition of a params section in front matter, we get a much better separation of Hugo configuration/metadata and user metadata.

Me do merge in the Hugo metadata keys that's not in the user defined map. Having a merged view of this is very convenient in some situations:

  • Access via .Params, e.g. .Params.summary, .Params.tags.
  • Used as keywords in Related.

But we can and should warn (but allow that warning to be turned off) when people do this and similar:

---
title: "Foo"
params:
   title: "Bar2"
---

Maybe not the greatest example, but is at least simple.

@bep bep added this to the v0.123.0 milestone Jan 30, 2024
@bep bep self-assigned this Jan 30, 2024
bep added a commit to bep/hugo that referenced this issue Jan 30, 2024
bep added a commit to bep/hugo that referenced this issue Jan 30, 2024
@bep bep closed this as completed in afee781 Jan 30, 2024
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 Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant