summaryrefslogtreecommitdiffstats
path: root/config
AgeCommit message (Collapse)Author
2023-05-28Fix it so languageCode on top level config still worksBjørn Erik Pedersen
This is common for monolingual sites, and we broke this in Hugo 0.112.4. Fixes #11037
2023-05-22Add cache busting config to support Tailwind 3Bjørn Erik Pedersen
Fixes #10974
2023-05-20Allow whitelisting mediaTypes used in resources.GetRemoteBjørn Erik Pedersen
Fixes #10286
2023-05-20Add hugo.WorkingDirBjørn Erik Pedersen
Fixes #10969
2023-05-20Make language merging of markup etc. config without values in the rootBjørn Erik Pedersen
Updates #10953
2023-05-19Allow legacy taxonomyTerm in disableKindsBjørn Erik Pedersen
Updates #10953
2023-05-19Fix warn message about custom params on the language top levelAndreas Deininger
2023-05-18all: Fix comments for exported functions and packagesOleksandr Redko
2023-05-18Allow empty params.mainSectionsBjørn Erik Pedersen
Updates #10953
2023-05-18commands: Load config before creating the filesystemBjørn Erik Pedersen
To allow publishDir to be set in config file.
2023-05-17commands: Improve the common build flag handlingBjørn Erik Pedersen
Updates #10947
2023-05-17Support, but warn, about top level language custom paramsBjørn Erik Pedersen
Updates #10947
2023-05-17Handle transient errors in config loading etc.Bjørn Erik Pedersen
As in: Get the Kubernetes site to build with the new Hugo version. 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-03-02Correct typos in Go commentsOleksandr Redko
2023-01-17config/security: Add O\w+ (e.g. GOROOT) to the default allowed listBjørn Erik Pedersen
Fixes #10429
2023-01-16Make hugo.toml the new config.tomlBjørn Erik Pedersen
Both will of course work, but hugo.toml will win if both are set. We should have done this a long time ago, of course, but the reason I'm picking this up now is that my VS Code setup by default picks up some JSON config schema from some random other software which also names its config files config.toml. Fixes #8979
2023-01-04Misc doc, code refactoring to improve documentationBjørn Erik Pedersen
2022-12-02config/security: Add CI env var to whitelistsepts
2022-10-02config/security: Fix filenameRicardo N Feliciano
2022-09-19config/security: Allow proxy variables in subcommandsMathieu Parent
In particular for go get
2022-09-14server: Add 404 supportBjørn Erik Pedersen
2022-08-26deps: Update github.com/pelletier/go-toml/v2 v2.0.2 => v2.0.4Bjørn Erik Pedersen
Closes #10210
2022-05-15server: Fix SIGINT handling after loading bad configurationBjørn Erik Pedersen
Also fix the config error messages. Fixes #9664
2022-05-15postcss: Fix import error handlingBjørn Erik Pedersen
Note that we will now fail if `inlineImports` is enabled and we cannot resolve an import. You can work around this by either: * Use url imports or imports with media queries. * Set `skipInlineImportsNotFound=true` in the options Also get the argument order in the different NewFileError* funcs in line. Fixes #9895
2022-05-14errors: Misc improvementsBjørn Erik Pedersen
* Redo the server error template * Always add the content file context if relevant * Remove some now superflous error string matching * Move the server error template to _server/error.html * Add file context (with position) to codeblock render blocks * Improve JS build errors Fixes #9892 Fixes #9891 Fixes #9893
2022-05-06Improve error messages, esp. when the server is runningBjørn Erik Pedersen
* Add file context to minifier errors when publishing * Misc fixes (see issues) * Allow custom server error template in layouts/server/error.html To get to this, this commit also cleans up and simplifies the code surrounding errors and files. This also removes the usage of `github.com/pkg/errors`, mostly because of https://github.com/pkg/errors/issues/223 -- but also because most of this is now built-in to Go. Fixes #9852 Fixes #9857 Fixes #9863
2022-04-08Rework the Destination filesystem to make --renderStaticToDisk workBjørn Erik Pedersen
See #9626
2022-03-21all: Use strings.CutBjørn Erik Pedersen
Updates #9687
2022-03-17all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen
Updates #9687
2022-02-23Remove Viper as a dependencyBjørn Erik Pedersen
2021-12-23Revert "config/security: Add HOME to default exec env var whitelist"Bjørn Erik Pedersen
There have been one report in the wild suggesting that this needs to be tested better before doing: https://discourse.gohugo.io/t/hugo-mod-failing-in-v0-91-1-but-works-in-v0-91-0/36180/5 This reverts commit fca266ebbb81af3d4479873a7a79759033c7ce25.
2021-12-22config/security: Add HOME to default exec env var whitelistBjørn Erik Pedersen
See #9309
2021-12-16Add some basic security policies with sensible defaultsBjørn Erik Pedersen
This ommmit contains some security hardening measures for the Hugo build runtime. There are some rarely used features in Hugo that would be good to have disabled by default. One example would be the "external helpers". For `asciidoctor` and some others we use Go's `os/exec` package to start a new process. These are a predefined set of binary names, all loaded from `PATH` and with a predefined set of arguments. Still, if you don't use `asciidoctor` in your project, you might as well have it turned off. You can configure your own in the new `security` configuration section, but the defaults are configured to create a minimal amount of site breakage. And if that do happen, you will get clear instructions in the loa about what to do. The default configuration is listed below. Note that almost all of these options are regular expression _whitelists_ (a string or a slice); the value `none` will block all. ```toml [security] enableInlineShortcodes = false [security.exec] allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$'] osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$'] [security.funcs] getenv = ['^HUGO_'] [security.http] methods = ['(?i)GET|POST'] urls = ['.*'] ```
2021-08-22Fix it so disableKinds etc. does not get merged in from themeBjørn Erik Pedersen
Unless the merge strategy is set up to do so. For `disableKinds` the current workaround is to make sure the project config has an entry, even if is empty: ``` disableKinds = [] ``` Note that this issue only touches root, non-map config-values that either is not set in project config or in Hugo's defaults. Fixes #8866
2021-08-03Make sure module config loading errors have file positioning infoBjørn Erik Pedersen
Fixes #8845
2021-07-26Deprecate Blackfriday and fix a potential deadlock in configBjørn Erik Pedersen
Note that the deadlock has not been seen earlier, in tests on in real Hugo sites. Fixes #8792 Fixes #8791
2021-07-10Add config.cascadeBjørn Erik Pedersen
This commit adds support for using the `cascade` keyword in your configuration file(s), e.g. `config.toml`. Note that * Every feature of `cascade` is available, e.g. `_target` to target specific page sets. * Pages, e.g. the home page, can overwrite the cascade defined in config. Fixes #8741
2021-06-29config: Fix handling of invalid OS env config overridesBjørn Erik Pedersen
Fixes #8709
2021-06-27Fix config handling with empty config entries after mergeBjørn Erik Pedersen
Fixes #8701
2021-06-24Fix language menu config regressionBjørn Erik Pedersen
Fixes #8672
2021-06-22config: Fix merge of config with map[string]string values.Bjørn Erik Pedersen
Fixes #8679
2021-06-18Implement configuration in a directory for modulesBjørn Erik Pedersen
Fixes #8654
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
2021-06-08Upgrade Instagram shortcodeBjørn Erik Pedersen
Fixes #7879
2021-05-30config: Fix env split to allow = character in values卜木
Fixes #8589
2020-12-16all: Fix minor typosPhil Davis
2020-12-03all: Format code with gofumptBjørn Erik Pedersen
See https://github.com/mvdan/gofumpt
2020-11-03Make js.Build fully support modulesBjørn Erik Pedersen
Fixes #7816 Fixes #7777 Fixes #7916
2020-10-05Add force flag to server redirects configBjørn Erik Pedersen
Fixes #7778