summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-01-04 18:24:36 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-05-16 18:01:29 +0200
commit241b21b0fd34d91fccb2ce69874110dceae6f926 (patch)
treed4e0118eac7e9c42f065815447a70805f8d6ad3e
parent6aededf6b42011c3039f5f66487a89a8dd65e0e7 (diff)
Create a struct with all of Hugo's config options
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
-rw-r--r--.gitignore3
-rw-r--r--cache/docs.go2
-rw-r--r--cache/filecache/filecache.go28
-rw-r--r--cache/filecache/filecache_config.go103
-rw-r--r--cache/filecache/filecache_config_test.go88
-rw-r--r--cache/filecache/filecache_pruner.go2
-rw-r--r--cache/filecache/filecache_pruner_test.go13
-rw-r--r--cache/filecache/filecache_test.go88
-rw-r--r--cache/filecache/integration_test.go9
-rw-r--r--commands/commandeer.go880
-rw-r--r--commands/commands.go341
-rw-r--r--commands/commands_test.go411
-rw-r--r--commands/config.go177
-rw-r--r--commands/convert.go202
-rw-r--r--commands/deploy.go84
-rw-r--r--commands/deploy_off.go48
-rw-r--r--commands/env.go83
-rw-r--r--commands/gen.go205
-rw-r--r--commands/genchromastyles.go72
-rw-r--r--commands/gendoc.go98
-rw-r--r--commands/gendocshelper.go71
-rw-r--r--commands/genman.go77
-rw-r--r--commands/helpers.go131
-rw-r--r--commands/hugo_test.go206
-rw-r--r--commands/hugo_windows.go2
-rw-r--r--commands/hugobuilder.go (renamed from commands/hugo.go)1098
-rw-r--r--commands/import.go (renamed from commands/import_jekyll.go)618
-rw-r--r--commands/import_jekyll_test.go177
-rw-r--r--commands/limit_darwin.go84
-rw-r--r--commands/limit_others.go21
-rw-r--r--commands/list.go279
-rw-r--r--commands/list_test.go68
-rw-r--r--commands/mod.go439
-rw-r--r--commands/mod_npm.go56
-rw-r--r--commands/new.go379
-rw-r--r--commands/new_content_test.go29
-rw-r--r--commands/new_site.go167
-rw-r--r--commands/new_theme.go176
-rw-r--r--commands/nodeploy.go51
-rw-r--r--commands/release.go79
-rw-r--r--commands/release_noop.go21
-rw-r--r--commands/server.go1101
-rw-r--r--commands/server_errors.go31
-rw-r--r--commands/server_test.go429
-rw-r--r--commands/static_syncer.go129
-rw-r--r--commands/version.go44
-rw-r--r--commands/xcommand_template.go78
-rw-r--r--common/hstrings/strings.go57
-rw-r--r--common/hstrings/strings_test.go (renamed from config/compositeConfig_test.go)28
-rw-r--r--common/htime/time.go9
-rw-r--r--common/hugo/hugo.go27
-rw-r--r--common/loggers/ignorableLogger.go10
-rw-r--r--common/maps/maps.go35
-rw-r--r--common/maps/maps_test.go8
-rw-r--r--common/maps/params.go98
-rw-r--r--common/maps/params_test.go16
-rw-r--r--common/urls/baseURL.go (renamed from hugolib/paths/baseURL.go)57
-rw-r--r--common/urls/baseURL_test.go (renamed from hugolib/paths/baseURL_test.go)22
-rw-r--r--config/allconfig/allconfig.go813
-rw-r--r--config/allconfig/alldecoders.go325
-rw-r--r--config/allconfig/configlanguage.go216
-rw-r--r--config/allconfig/integration_test.go71
-rw-r--r--config/allconfig/load.go559
-rw-r--r--config/allconfig/load_test.go67
-rw-r--r--config/commonConfig.go131
-rw-r--r--config/commonConfig_test.go5
-rw-r--r--config/compositeConfig.go117
-rw-r--r--config/configLoader.go8
-rw-r--r--config/configProvider.go67
-rw-r--r--config/defaultConfigProvider.go97
-rw-r--r--config/namespace.go76
-rw-r--r--config/namespace_test.go68
-rw-r--r--config/security/securityConfig.go6
-rw-r--r--config/services/servicesConfig_test.go2
-rw-r--r--config/testconfig/testconfig.go84
-rw-r--r--create/content.go2
-rw-r--r--create/content_test.go22
-rw-r--r--deploy/deploy.go92
-rw-r--r--deploy/deployConfig.go62
-rw-r--r--deploy/deployConfig_test.go12
-rw-r--r--deploy/deploy_test.go58
-rw-r--r--deps/deps.go450
-rw-r--r--deps/deps_test.go5
-rw-r--r--go.mod9
-rw-r--r--go.sum12
-rw-r--r--helpers/content.go37
-rw-r--r--helpers/content_test.go71
-rw-r--r--helpers/general.go14
-rw-r--r--helpers/general_test.go79
-rw-r--r--helpers/path.go17
-rw-r--r--helpers/path_test.go85
-rw-r--r--helpers/pathspec.go11
-rw-r--r--helpers/pathspec_test.go62
-rw-r--r--helpers/testhelpers_test.go58
-rw-r--r--helpers/url.go33
-rw-r--r--helpers/url_test.go142
-rw-r--r--hugofs/fs.go43
-rw-r--r--hugofs/fs_test.go22
-rw-r--r--hugofs/noop_fs.go10
-rw-r--r--hugofs/rootmapping_fs_test.go2
-rw-r--r--hugolib/alias.go2
-rw-r--r--hugolib/breaking_changes_test.go118
-rw-r--r--hugolib/cascade_test.go54
-rw-r--r--hugolib/codeowners.go5
-rw-r--r--hugolib/config.go670
-rw-r--r--hugolib/config_test.go577
-rw-r--r--hugolib/configdir_test.go153
-rw-r--r--hugolib/content_map.go2
-rw-r--r--hugolib/content_map_page.go10
-rw-r--r--hugolib/datafiles_test.go444
-rw-r--r--hugolib/dates_test.go2
-rw-r--r--hugolib/embedded_shortcodes_test.go422
-rw-r--r--hugolib/filesystems/basefs.go24
-rw-r--r--hugolib/filesystems/basefs_test.go231
-rw-r--r--hugolib/gitinfo.go4
-rw-r--r--hugolib/hugo_modules_test.go35
-rw-r--r--hugolib/hugo_sites.go343
-rw-r--r--hugolib/hugo_sites_build.go100
-rw-r--r--hugolib/hugo_sites_build_errors_test.go1
-rw-r--r--hugolib/hugo_sites_build_test.go19
-rw-r--r--hugolib/hugo_sites_multihost_test.go2
-rw-r--r--hugolib/hugo_smoke_test.go26
-rw-r--r--hugolib/integrationtest_builder.go67
-rw-r--r--hugolib/language_content_dir_test.go2
-rw-r--r--hugolib/menu_test.go33
-rw-r--r--