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

hooks: shareable settings with defaults #19

Open
davidsneighbour opened this issue Jul 28, 2022 · 0 comments
Open

hooks: shareable settings with defaults #19

davidsneighbour opened this issue Jul 28, 2022 · 0 comments
Assignees
Labels
module:hooks state:confirmed This issue is confirmed. type:enhancement New enhancements and features.

Comments

@davidsneighbour
Copy link
Owner

davidsneighbour commented Jul 28, 2022

We have hooks that execute and print code in our templates. How about having some form of pluggable truth giving variables.

Sample:

in the config:

[truther]
some.parameter.name = false

in the layout:

{{ with (site.Params.some.parameter.name | default true) }}
do something
{{ end }}

Sure, this could be on a per template/theme base, but with a reusable system this could be used to enable/disable date display, comment forms on a global or even local (frontmatter params) level and reuse documentation for these settings.

The executing code could be some form of

{{ if partial "truths.html" (dict 
                 "variable" "some.parameter.name" 
                 "value" "local value" 
                 "default" true) }}
do something
{{ end }}

and the partial could take care of sanitisation, comments in the CLI output, collection of available settings, etc.

@davidsneighbour davidsneighbour self-assigned this Jul 28, 2022
@davidsneighbour davidsneighbour changed the title Truthers: settable hooks with defaults Truthers: shareable settings with defaults Jul 28, 2022
@davidsneighbour davidsneighbour changed the title Truthers: shareable settings with defaults hugo-hooks: shareable settings with defaults Mar 30, 2023
@davidsneighbour davidsneighbour transferred this issue from davidsneighbour/hugo-hooks Mar 30, 2023
@davidsneighbour davidsneighbour changed the title hugo-hooks: shareable settings with defaults hooks: shareable settings with defaults Mar 3, 2024
@davidsneighbour davidsneighbour added state:unconfirmed This issue needs to be reproduced. module:hooks state:confirmed This issue is confirmed. type:enhancement New enhancements and features. and removed state:unconfirmed This issue needs to be reproduced. labels Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:hooks state:confirmed This issue is confirmed. type:enhancement New enhancements and features.
Projects
None yet
Development

No branches or pull requests

1 participant