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

Conversation

@bep
Copy link
Member

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 bep:theme-config branch 7 times, most recently from 8857deb to 183f929 Mar 18, 2018
To prepare for config in themes

See #4490
@bep bep force-pushed the bep:theme-config branch 6 times, most recently from 7633294 to 8c8d344 Mar 20, 2018
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 #4490
@bep bep force-pushed the bep:theme-config branch from 8c8d344 to e9c7b62 Mar 21, 2018
@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
2 of 4 checks passed
2 of 4 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/branch Waiting for AppVeyor build to complete
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.