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

Allow some config from themes #4514

Merged
merged 2 commits into from
Mar 21, 2018
Merged

Allow some config from themes #4514

merged 2 commits into from
Mar 21, 2018

Conversation

bep
Copy link
Member

@bep bep commented Mar 18, 2018

See #4490

This allows a config.toml in the theme to set

  1. params (but cannot override params in project. Will also get its own "namespace", i.e. {{ .Site.Params.mytheme.my_param }} will be the same as {{ .Site.Params.my_param }} providing that the main project does not define a param with that key.
  2. menu -- but cannot redefine/add menus in the project. Must create its own menus with its own identifiers.
  3. languages -- only params and menu. Same rules as above.
  4. new outputFormats
  5. new mediaTypes

@bep bep force-pushed the theme-config branch 7 times, most recently from 8857deb to 183f929 Compare March 19, 2018 19:56
To prepare for config in themes

See gohugoio#4490
@bep bep force-pushed the theme-config branch 6 times, most recently from 7633294 to 8c8d344 Compare March 21, 2018 07:55
This allows a `config.toml` (or `yaml`, ´yml`, or `json`)  in the theme to set:

1) `params` (but cannot override params in project. Will also get its own "namespace", i.e. `{{ .Site.Params.mytheme.my_param }}` will be the same as `{{ .Site.Params.my_param }}` providing that the main project does not define a param with that key.
2) `menu` -- but cannot redefine/add menus in the project. Must create its own menus with its own identifiers.
3) `languages` -- only `params` and `menu`. Same rules as above.
4) **new** `outputFormats`
5) **new** `mediaTypes`

This should help with the "theme portability" issue and people having to copy and paste lots of setting into their projects.

Fixes gohugoio#4490
@bep bep changed the title WORK IN PROGRESS: Allow some config from themes Allow some config from themes Mar 21, 2018
@bep bep merged commit e9c7b62 into gohugoio:master Mar 21, 2018
@github-actions
Copy link

github-actions bot commented Feb 6, 2022

This pull request 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 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant