Debian Codegraph @

docs/content/en/configuration/all.md

raw
1 ---
2 title: All settings
3 description: The complete list of Hugo configuration settings.
4 categories: []
5 keywords: []
6 weight: 20
7 aliases: [/getting-started/configuration/]
8 ---
9
10 ## Settings
11
12 `archetypeDir`
13 : (`string`) The designated directory for [archetypes](g). Default is `archetypes`. {{% module-mounts-note %}}
14
15 `assetDir`
16 : (`string`) The designated directory for [global resources](g). Default is `assets`. {{% module-mounts-note %}}
17
18 `baseURL`
19 : (`string`) The absolute URL of your published site including the protocol, host, path, and a trailing slash.
20
21 `build`
22 : See [configure build][].
23
24 `buildDrafts`
25 : (`bool`) Whether to include draft content when building a site. Default is `false`.
26
27 `buildExpired`
28 : (`bool`) Whether to include expired content when building a site. Default is `false`.
29
30 `buildFuture`
31 : (`bool`) Whether to include future content when building a site. Default is `false`.
32
33 `cacheDir`
34 : (`string`) The designated cache directory. See [details](#cache-directory).
35
36 `caches`
37 : See [configure file caches][].
38
39 `canonifyURLs`
40 : (`bool`) See [details][canonical-urls] before enabling this feature. Default is `false`.
41
42 `capitalizeListTitles`
43 : (`bool`) Whether to capitalize automatic list titles. Applicable to section, taxonomy, and term pages. Use the [`titleCaseStyle`](#titlecasestyle) setting to configure capitalization rules. Default is `true`.
44
45 `cascade`
46 : See [configure cascade][].
47
48 `cleanDestinationDir`
49 : (`bool`) Whether to remove files from the [`publishDir`](#publishdir) that do not exist in the [`staticDir`](#staticdir). Hugo performs this cleanup before rendering, so the current build's rendered output is unaffected. If the `staticDir` does not exist, the cleanup does not run. Note that `.gitignore` and `.gitattributes` files are always preserved, as are directories whose names begin with a dot, provided their parent directory also survives. Default is `false`.
50
51 `contentDir`
52 : (`string`) The designated directory for content files. Default is `content`. {{% module-mounts-note %}}
53
54 `copyright`
55 : (`string`) The copyright notice for a site, typically displayed in the footer.
56
57 `dataDir`
58 : (`string`) The designated directory for data files. Default is `data`. {{% module-mounts-note %}}
59
60 `defaultContentLanguage`
61 : (`string`) The project's [default language](g), conforming to the syntax described in [RFC 5646][]. When one or more languages are defined, this value must match one of the defined [language keys][].
62
63 `defaultContentLanguageInSubdir`
64 : (`bool`) Whether to publish the default content language to a subdirectory matching the [`defaultContentLanguage`](#defaultcontentlanguage). Default is `false`.
65
66 `defaultContentRole`
67 : {{< new-in 0.153.0 />}}
68 : (`string`) The project's [default role](g). When one or more roles are defined, this value must match one of the defined role names.
69
70 `defaultContentRoleInSubdir`
71 : {{< new-in 0.153.0 />}}
72 : (`bool`) Whether to publish the default content role to a subdirectory matching the [`defaultContentRole`](#defaultcontentrole). Default is `false`.
73
74 `defaultContentVersion`
75 : {{< new-in 0.153.0 />}}
76 : (`string`) The project's [default version](g). When one or more versions are defined, this value must match one of the defined version names.
77
78 `defaultContentVersionInSubdir`
79 : {{< new-in 0.153.0 />}}
80 : (`bool`) Whether to publish the default content version to a subdirectory matching the [`defaultContentVersion`](#defaultcontentversion). Default is `false`.
81
82 `defaultOutputFormat`
83 : (`string`) The default output format for the site. If unspecified, the first available format in the defined order (by weight, then alphabetically) will be used.
84
85 `deployment`
86 : See [configure deployment][].
87
88 `disableAliases`
89 : (`bool`) Whether to disable the generation of HTML redirect files for each path defined in the [`aliases`][aliases_front_matter] front matter field. When `true`, Hugo will not create physical files for [client-side redirection][], but the alias data remains available via the [`Aliases`][aliases_page_method] method on a `Page` object. Default is `false`.
90
91 `disableDefaultLanguageRedirect`
92 : {{< new-in 0.140.0 />}}
93 : (`bool`) Whether to disable generation of the alias redirect for the default content language. When [`defaultContentLanguageInSubdir`](#defaultcontentlanguageinsubdir) is `true`, this setting prevents the root directory from redirecting to the language subdirectory. Conversely, when `defaultContentLanguageInSubdir` is `false`, this setting prevents the language subdirectory from redirecting to the root directory. This is superseded by the more general [`disableDefaultSiteRedirect`](#disabledefaultsiteredirect) setting. Default is `false`.
94
95 `disableDefaultSiteRedirect`
96 : {{< new-in 0.154.5 />}}
97 : (`bool`) Whether to disable generation of the alias redirect to the [default site](g). When [`defaultContentLanguageInSubdir`](#defaultcontentlanguageinsubdir), [`defaultContentRoleInSubdir`](#defaultcontentroleinsubdir), or [`defaultContentVersionInSubdir`](#defaultcontentversioninsubdir) is `true`, this prevents the root directory from redirecting to the default site's subdirectory. Conversely, when these are `false`, it prevents the subdirectories from redirecting back to the root. Default is `false`.
98
99 `disableHugoGeneratorInject`
100 : (`bool`) Whether to disable injection of a `<meta name="generator">` tag into the home page. Default is `false`.
101
102 `disableKinds`
103 : (`[]string`) A slice of page [kinds](g) to disable during the build process, any of `404`, `home`, `page`, `robotstxt`, `rss`, `section`, `sitemap`, `taxonomy`, or `term`.
104
105 `disableLanguages`
106 : (`[]string`) A slice of language keys representing the languages to disable during the build process. Although this is functional, consider using the [`disabled`][] key under each language instead.
107
108 `disableLiveReload`
109 : (`bool`) Whether to disable automatic live reloading of the browser window. Default is `false`.
110
111 `disablePathToLower`
112 : (`bool`) Whether to disable transformation of page URLs to lower case. Default is `false`.
113
114 `enableEmoji`
115 : (`bool`) Whether to allow emoji in Markdown. Default is `false`.
116
117 `enableGitInfo`
118 : (`bool`) Whether to retrieve commit metadata from the Git history of your local project and any [modules](g). This enables the [`GitInfo`][] method on a `Page` object. With the default front matter configuration, the [`Lastmod`][] method on a `Page` object returns the Git author date of the last commit for that file. Default is `false`.
119
120 `enableMissingTranslationPlaceholders`
121 : (`bool`) Whether to show a placeholder instead of the default value or an empty string if a translation is missing. Default is `false`.
122
123 `enableRobotsTXT`
124 : (`bool`) Whether to enable generation of a `robots.txt` file. Default is `false`.
125
126 `frontmatter`
127 : See [configure front matter][].
128
129 `hasCJKLanguage`
130 : (`bool`) Whether to automatically detect [CJK](g) languages in content. Affects the values returned by the [`FuzzyWordCount`][], [`ReadingTime`][], [`Summary`][], and [`WordCount`][] methods. To override this behavior on a given page, set the [`isCJKLanguage`][] field in its front matter. Default is `false`.
131
132 `HTTPCache`
133 : See [configure HTTP cache][].
134
135 `i18nDir`
136 : (`string`) The designated directory for translation tables. Default is `i18n`. {{% module-mounts-note %}}
137
138 `ignoreCache`
139 : (`bool`) Whether to ignore the configured file caches. Default is `false`.
140
141 `ignoreFiles`
142 : (`[]string`) A slice of [regular expressions](g) used to exclude specific files from a build. These expressions are matched against the absolute file path and apply to files within the `content`, `data`, and `i18n` directories. For more advanced file exclusion options, see the section on [module mounts][].
143
144 `ignoreLogs`
145 : (`[]string`) A slice of message identifiers corresponding to warnings and errors you wish to suppress. See [`erroridf`][] and [`warnidf`][].
146
147 `ignoreVendorPaths`
148 : (`string`) A [glob pattern](g) matching the module paths to exclude from the `_vendor` directory.
149
150 `imaging`
151 : See [configure imaging][].
152
153 `languageCode`
154 : {{<deprecated-in 0.158.0 />}}
155 : Use [`locale`](#locale) instead.
156
157 `languages`
158 : See [configure languages][].
159
160 `layoutDir`
161 : (`string`) The designated directory for templates. Default is `layouts`. {{% module-mounts-note %}}
162
163 {{% include "/_common/configuration/locale.md" %}}
164
165 For a multilingual project, specify this value independently for each language key. See [configure languages][].
166
167 `mainSections`
168 : (`string` or `[]string`) The main sections of a site. If set, the [`MainSections`][] method on the `Site` object returns the given sections, otherwise it returns the section with the most pages.
169
170 `markup`
171 : See [configure markup][].
172
173 `mediaTypes`
174 : See [configure media types][].
175
176 `menus`
177 : See [configure menus][].
178
179 `minify`
180 : See [configure minify][].
181
182 `module`
183 : See [configure modules][].
184
185 `newContentEditor`
186 : (`string`) The editor to use when creating new content.
187
188 `noBuildLock`
189 : (`bool`) Whether to disable creation of the `.hugo_build.lock` file. Default is `false`.
190
191 `noChmod`
192 : (`bool`) Whether to disable synchronization of file permission modes. Default is `false`.
193
194 `noTimes`
195 : (`bool`) Whether to disable synchronization of file modification times. Default is `false`.
196
197 `outputFormats`
198 : See [configure output formats][].
199
200 `outputs`
201 : See [configure outputs][].
202
203 `page`
204 : See [configure page][].
205
206 `pagination`
207 : See [configure pagination][].
208
209 `panicOnWarning`
210 : (`bool`) Whether to panic on the first WARNING. Default is `false`.
211
212 `params`
213 : See [configure params][].
214
215 `permalinks`
216 : See [configure permalinks][].
217
218 `pluralizeListTitles`
219 : (`bool`) Whether to pluralize automatic list titles. Applicable to section pages. Default is `true`.
220
221 `printI18nWarnings`
222 : (`bool`) Whether to log WARNINGs for each missing translation. Default is `false`.
223
224 `printPathWarnings`
225 : (`bool`) Whether to log WARNINGs when Hugo publishes two or more files to the same path. Default is `false`.
226
227 `printUnusedTemplates`
228 : (`bool`) Whether to log WARNINGs for each unused template. Default is `false`.
229
230 `privacy`
231 : See [configure privacy][].
232
233 `publishDir`
234 : (`string`) The designated directory for publishing the site. Default is `public`.
235
236 `refLinksErrorLevel`
237 : (`string`) The logging error level to use when the `ref` and `relref` functions, methods, and shortcodes are unable to resolve a reference to a page. Either `ERROR` or `WARNING`. Any `ERROR` will fail the build. Default is `ERROR`.
238
239 `refLinksNotFoundURL`
240 : (`string`) The URL to return when the `ref` and `relref` functions, methods, and shortcodes are unable to resolve a reference to a page.
241
242 `related`
243 : See [configure related content][].
244
245 `relativeURLs`
246 : (`bool`) See [details][relative-urls] before enabling this feature. Default is `false`.
247
248 `removePathAccents`
249 : (`bool`) Whether to remove [non-spacing marks][] from [composite characters][] in content paths. Default is `false`.
250
251 `renderSegments`
252 : (`[]string`) A slice of [segments](g) to render. If omitted, all segments are rendered. This option is typically set via a command-line flag, such as `hugo build --renderSegments segment1,segment2`. The provided segment names must correspond to those defined in the [`segments`][] configuration.
253
254 `resourceDir`
255 : (`string`) The designated directory for caching output from [asset pipelines](g). Default is `resources`.
256
257 `roles`
258 : See [configure roles][].
259
260 `security`
261 : See [configure security][].
262
263 `sectionPagesMenu`
264 : (`string`) When set, each top-level section will be added to the menu identified by the provided value. See [details][define-automatically].
265
266 `segments`
267 : See [configure segments][].
268
269 `server`
270 : See [configure server][].
271
272 `services`
273 : See [configure services][].
274
275 `sitemap`
276 : See [configure sitemap][].
277
278 `staticDir`
279 : (`string`) The designated directory for static files. Default is `static`. {{% module-mounts-note %}}
280
281 `summaryLength`
282 : (`int`) Applicable to [automatic summaries][], the minimum number of words returned by the [`Summary`][] method on a `Page` object. The `Summary` method will return content truncated at the paragraph boundary closest to the specified `summaryLength`, but at least this minimum number of words. Default is `70`.
283
284 `taxonomies`
285 : See [configure taxonomies][].
286
287 `templateMetrics`
288 : (`bool`) Whether to print template execution metrics to the console. Default is `false`. See [details][template-metrics].
289
290 `templateMetricsHints`
291 : (`bool`) Whether to print template execution improvement hints to the console. Applicable when `templateMetrics` is `true`. Default is `false`. See [details][template-metrics].
292
293 `theme`
294 : (`string` or `[]string`) The [theme](g) to use. Multiple themes can be listed, with precedence given from left to right. See [details][].
295
296 `themesDir`
297 : (`string`) The designated directory for themes. Default is `themes`.
298
299 `timeout`
300 : (`string`) The timeout for generating page content, either as a [duration][] or in seconds. This timeout is used to prevent infinite recursion during content generation. You may need to increase this value if your pages take a long time to generate, for example, due to extensive image processing or reliance on remote content. Default is `60s`.
301
302 `timeZone`
303 : (`string`) The time zone used to parse dates without time zone offsets, including front matter date fields and values passed to the [`time.AsTime`][] and [`time.Format`][] functions. The list of valid values may be system dependent, but should include `UTC`, `Local`, and any location in the [IANA Time Zone Database][]. For example, `America/Los_Angeles` and `Europe/Oslo` are valid time zones.
304
305 `title`
306 : (`string`) The site title.
307
308 `titleCaseStyle`
309 : (`string`) The capitalization rules to follow when Hugo automatically generates a section title, or when using the [`strings.Title`][] function. One of `ap`, `chicago`, `go`, `firstupper`, or `none`. Default is `ap`. See [details](#title-case-style).
310
311 `uglyurls`
312 : See [configure ugly URLs][].
313
314 `versions`
315 : See [configure versions][].
316
317 ## Cache directory
318
319 Hugo's file cache directory is configurable via the [`cacheDir`](#cachedir) setting or the `HUGO_CACHEDIR` environment variable. If neither is set, Hugo will use, in order of preference:
320
321 1. If running on Netlify: `/opt/build/cache/hugo_cache/`. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other [CI/CD](g) platforms, please read their documentation. For a CircleCI example, see [this configuration][].
322 1. In a `hugo_cache` directory below the OS user cache directory as defined by Go's [`os.UserCacheDir`][] function. On Unix systems, per the [XDG base directory specification][], this is `$XDG_CACHE_HOME` if non-empty, else `$HOME/.cache`. On MacOS, this is `$HOME/Library/Caches`. On Windows, this is`%LocalAppData%`. On Plan 9, this is `$home/lib/cache`.
323 1. In a `hugo_cache_$USER` directory below the OS temp dir.
324
325 To determine the current `cacheDir`:
326
327 ```sh
328 hugo config | grep cachedir
329 ```
330
331 ## Title case style
332
333 Hugo's [`titleCaseStyle`](#titlecasestyle) setting governs capitalization for automatically generated section titles and the [`strings.Title`][] function. By default, it follows the capitalization rules published in the Associated Press Stylebook. Change this setting to use other capitalization rules.
334
335 `ap`
336 : Use the capitalization rules published in the [Associated Press Stylebook][]. This is the default.
337
338 `chicago`
339 : Use the capitalization rules published in the [Chicago Manual of Style][].
340
341 `go`
342 : Capitalize the first letter of every word.
343
344 `firstupper`
345 : Capitalize the first letter of the first word.
346
347 `none`
348 : Disable transformation of automatic section titles, and disable the transformation performed by the `strings.Title` function. This is useful if you would prefer to manually capitalize section titles as needed, and to bypass opinionated theme usage of the `strings.Title` function.
349
350 ## Localized settings
351
352 Some configuration settings, such as menus and custom parameters, can be defined separately for each language. See [configure languages][].
353
354 [Associated Press Stylebook]: https://www.apstylebook.com/
355 [Chicago Manual of Style]: https://www.chicagomanualofstyle.org/home.html
356 [IANA Time Zone Database]: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
357 [RFC 5646]: https://datatracker.ietf.org/doc/html/rfc5646#section-2.1
358 [XDG base directory specification]: https://specifications.freedesktop.org/basedir-spec/latest/
359 [`FuzzyWordCount`]: /methods/page/fuzzywordcount/
360 [`GitInfo`]: /methods/page/gitinfo/
361 [`Lastmod`]: /methods/page/lastmod/
362 [`MainSections`]: /methods/site/mainsections/
363 [`ReadingTime`]: /methods/page/readingtime/
364 [`Summary`]: /methods/page/summary/
365 [`WordCount`]: /methods/page/wordcount/
366 [`disabled`]: /configuration/languages/#disabled
367 [`erroridf`]: /functions/fmt/erroridf/
368 [`isCJKLanguage`]: /content-management/front-matter/#iscjklanguage
369 [`os.UserCacheDir`]: https://pkg.go.dev/os#UserCacheDir
370 [`segments`]: /configuration/segments/
371 [`strings.Title`]: /functions/strings/title/
372 [`time.AsTime`]: /functions/time/astime/
373 [`time.Format`]: /functions/time/format/
374 [`warnidf`]: /functions/fmt/warnidf/
375 [aliases_front_matter]: /content-management/front-matter/#aliases
376 [aliases_page_method]: /methods/page/aliases/
377 [automatic summaries]: /content-management/summaries/#automatic-summary
378 [canonical-urls]: /content-management/urls/#canonical-urls
379 [client-side redirection]: /content-management/urls/#client-side-redirection
380 [composite characters]: https://en.wikipedia.org/wiki/Precomposed_character
381 [configure HTTP cache]: /configuration/http-cache/
382 [configure build]: /configuration/build/
383 [configure cascade]: /configuration/cascade/
384 [configure deployment]: /configuration/deployment/
385 [configure file caches]: /configuration/caches/
386 [configure front matter]: /configuration/front-matter/
387 [configure imaging]: /configuration/imaging/
388 [configure languages]: /configuration/languages/
389 [configure markup]: /configuration/markup/
390 [configure media types]: /configuration/media-types/
391 [configure menus]: /configuration/menus/
392 [configure minify]: /configuration/minify/
393 [configure modules]: /configuration/module/
394 [configure output formats]: /configuration/output-formats/
395 [configure outputs]: /configuration/outputs/
396 [configure page]: /configuration/page/
397 [configure pagination]: /configuration/pagination/
398 [configure params]: /configuration/params/
399 [configure permalinks]: /configuration/permalinks/
400 [configure privacy]: /configuration/privacy/
401 [configure related content]: /configuration/related-content/
402 [configure roles]: /configuration/roles/
403 [configure security]: /configuration/security/
404 [configure segments]: /configuration/segments/
405 [configure server]: /configuration/server/
406 [configure services]: /configuration/services/
407 [configure sitemap]: /configuration/sitemap/
408 [configure taxonomies]: /configuration/taxonomies/
409 [configure ugly URLs]: /configuration/ugly-urls/
410 [configure versions]: /configuration/versions/
411 [define-automatically]: /content-management/menus/#define-automatically
412 [details]: /hugo-modules/theme-components/
413 [duration]: https://pkg.go.dev/time#Duration
414 [language keys]: /configuration/languages/#language-keys
415 [module mounts]: /configuration/module/#mounts
416 [non-spacing marks]: https://www.compart.com/en/unicode/category/Mn
417 [relative-urls]: /content-management/urls/#relative-urls
418 [template-metrics]: /troubleshooting/performance/#template-metrics
419 [this configuration]: https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml