summaryrefslogtreecommitdiffstats
path: root/commands/config.go
AgeCommit message (Collapse)Author
2023-06-21commands: Make hugo env respect --logLevelBjørn Erik Pedersen
Fixes #11145
2023-06-01commands: Add --lang to hugo configBjørn Erik Pedersen
Fixes #11057
2023-05-28commands: Add the common build flags to the config commandsBjørn Erik Pedersen
Which allows to see the config with `--theme` applied. Updates #11018
2023-05-27commands: Move the --format flag to only the commands that support itBjørn Erik Pedersen
Fixes #11022
2023-05-22Add --format to hugo configBjørn Erik Pedersen
Now default to TOML.
2023-05-17commands: Improve the common build flag handlingBjørn Erik Pedersen
Updates #10947
2023-05-16Create a struct with all of Hugo's config optionsBjørn Erik Pedersen
Primary motivation is documentation, but it will also hopefully simplify the code. Also, * Lower case the default output format names; this is in line with the custom ones (map keys) and how it's treated all the places. This avoids doing `stringds.EqualFold` everywhere. Closes #10896 Closes #10620
2023-01-04Misc doc, code refactoring to improve documentationBjørn Erik Pedersen
2022-03-17all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen
Updates #9687
2021-08-31commands: Don't fail on template errors on go mod graph etc.Bjørn Erik Pedersen
Fixes #8942
2021-06-27modules: Use value type for module.TimeBjørn Erik Pedersen
Which is in line with how we do it elsewhere.
2021-06-27commands: Add version time to "hugo config mounts"Bjørn Erik Pedersen
2021-06-27commands: Add some more info to "hugo config mounts"Bjørn Erik Pedersen
* Add owner path and version. * Also add thme meta info and Hugo version when run with -v flag
2021-06-14Misc config loading fixesBjørn Erik Pedersen
The main motivation behind this is simplicity and correctnes, but the new small config library is also faster: ``` BenchmarkDefaultConfigProvider/Viper-16 252418 4546 ns/op 2720 B/op 30 allocs/op BenchmarkDefaultConfigProvider/Custom-16 450756 2651 ns/op 1008 B/op 6 allocs/op ``` Fixes #8633 Fixes #8618 Fixes #8630 Updates #8591 Closes #6680 Closes #5192
2020-01-31commands: Fix config environment handlingBjørn Erik Pedersen
Fixes #6503 Fixes #6824
2019-07-31commands: Add "hugo config mounts" commandBjørn Erik Pedersen
This prints the effective file mounts in a project. Fixes #6144
2019-07-31commands: Cleanup the hugo config commandBjørn Erik Pedersen
Most importantly filter out some keys not relevant for the end user. See #6144
2018-06-10Add support for theme composition and inheritanceBjørn Erik Pedersen
This commit adds support for theme composition and inheritance in Hugo. With this, it helps thinking about a theme as a set of ordered components: ```toml theme = ["my-shortcodes", "base-theme", "hyde"] ``` The theme definition example above in `config.toml` creates a theme with the 3 components with presedence from left to right. So, Hugo will, for any given file, data entry etc., look first in the project, and then in `my-shortcode`, `base-theme` and lastly `hyde`. Hugo uses two different algorithms to merge the filesystems, depending on the file type: * For `i18n` and `data` files, Hugo merges deeply using the translation id and data key inside the files. * For `static`, `layouts` (templates) and `archetypes` files, these are merged on file level. So the left-most file will be chosen. The name used in the `theme` definition above must match a folder in `/your-site/themes`, e.g. `/your-site/themes/my-shortcodes`. There are plans to improve on this and get a URL scheme so this can be resolved automatically. Also note that a component that is part of a theme can have its own configuration file, e.g. `config.toml`. There are currently some restrictions to what a theme component can configure: * `params` (global and per language) * `menu` (global and per language) * `outputformats` and `mediatypes` The same rules apply here: The left-most param/menu etc. with the same ID will win. There are some hidden and experimental namespace support in the above, which we will work to improve in the future, but theme authors are encouraged to create their own namespaces to avoid naming conflicts. A final note: Themes/components can also have a `theme` definition in their `config.toml` and similar, which is the "inheritance" part of this commit's title. This is currently not supported by the Hugo theme site. We will have to wait for some "auto dependency" feature to be implemented for that to happen, but this can be a powerful feature if you want to create your own theme-variant based on others. Fixes #4460 Fixes #4450
2018-04-11commands: Fix the config commandBjørn Erik Pedersen
It now also accepts the `-s` (source) flag. See #4598