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

Add the [params] concept to front matter #11934

Merged
merged 1 commit into from
Jan 28, 2024
Merged

Conversation

bep
Copy link
Member

@bep bep commented Jan 28, 2024

This is deliberately very simple, but should not break anything. We need to introduce this in baby steps, but this should allow us to introduce this in the documentation.

Note that the params section's key/values will be added to .Params last. This means that you can have different values for "Hugo's summary" and the custom ".Params.summary" if you want to.

Updates #11055

@bep bep force-pushed the feat/params-11055 branch from 2f44d10 to 5724e56 Compare January 28, 2024 17:15
This is deliberately very simple, but should not break anything. We need to introduce this in baby steps, but this should allow us to introduce this in the documentation.

Note that the `params` section's key/values will be added to `.Params` last. This means that you can have different values for "Hugo's summary" and the custom ".Params.summary" if you want to.

Updates gohugoio#11055
@bep bep force-pushed the feat/params-11055 branch from 5724e56 to 736b46f Compare January 28, 2024 17:38
@bep
Copy link
Member Author

bep commented Jan 28, 2024

@jmooring what do you think? Note that I have deliberately not tried to solve all of the related issues (e.g. taxonomies).

@jmooring
Copy link
Member

jmooring commented Jan 28, 2024

Findings...

  • 👍 Taxonomies works both in root and under params.
  • 👍 When key is duplicated in both root and params, params wins

Should we throw an error or warning if key is defined in both root and under params? Conceptually it's a duplicate. I believe we normally rely on the unmarshaler to handle that for us, so I guess this would be some extra work.

@bep
Copy link
Member Author

bep commented Jan 28, 2024

Should we throw an error or warning if key is defined in both root and under params?

For the short term, I think we say that that's a feature and not an error situation (as my summary example kind of demonstrates). I have left the original issue open, though.

@bep bep merged commit 6dedb4e into gohugoio:master Jan 28, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants