hugo

Fork of github.com/gohugoio/hugo with reverse pagination support

git clone git://git.shimmy1996.com/hugo.git

configuration.md (24903B)

    1 ---
    2 title: Configure Hugo
    3 linktitle: Configuration
    4 description: How to configure your Hugo site.
    5 date: 2013-07-01
    6 publishdate: 2017-01-02
    7 lastmod: 2017-03-05
    8 categories: [getting started,fundamentals]
    9 keywords: [configuration,toml,yaml,json]
   10 menu:
   11   docs:
   12     parent: "getting-started"
   13     weight: 60
   14 weight: 60
   15 sections_weight: 60
   16 draft: false
   17 aliases: [/overview/source-directory/,/overview/configuration/]
   18 toc: true
   19 ---
   20 
   21 
   22 ## Configuration File
   23 
   24 Hugo uses the `config.toml`, `config.yaml`, or `config.json` (if found in the
   25 site root) as the default site config file.
   26 
   27 The user can choose to override that default with one or more site config files
   28 using the command line `--config` switch.
   29 
   30 Examples:
   31 
   32 ```
   33 hugo --config debugconfig.toml
   34 hugo --config a.toml,b.toml,c.toml
   35 ```
   36 
   37 {{% note %}}
   38 Multiple site config files can be specified as a comma-separated string to the `--config` switch.
   39 {{% /note %}}
   40 
   41 {{< todo >}}TODO: distinct config.toml and others (the root object files){{< /todo >}}
   42 
   43 ## Configuration Directory
   44 
   45 In addition to using a single site config file, one can use the `configDir` directory (default to `config/`) to maintain easier organization and environment specific settings.
   46 
   47 - Each file represents a configuration root object, such as `params.toml` for `[Params]`, `menu(s).toml` for `[Menu]`, `languages.toml` for `[Languages]` etc...
   48 - Each file's content must be top-level, for example:
   49 
   50 {{< code-toggle file="config" >}}
   51 [Params]
   52   foo = "bar"
   53 {{< /code-toggle >}}
   54 
   55 {{< code-toggle file="params" >}}
   56 foo = "bar"
   57 {{< /code-toggle >}}
   58 
   59 - Each directory holds a group of files containing settings unique to an environment.
   60 - Files can be localized to become language specific.
   61 
   62 
   63 ```
   64 ├── config
   65 │   ├── _default
   66 │   │   ├── config.toml
   67 │   │   ├── languages.toml
   68 │   │   ├── menus.en.toml
   69 │   │   ├── menus.zh.toml
   70 │   │   └── params.toml
   71 │   ├── production
   72 │   │   ├── config.toml
   73 │   │   └── params.toml
   74 │   └── staging
   75 │       ├── config.toml
   76 │       └── params.toml
   77 ```
   78 
   79 Considering the structure above, when running `hugo --environment staging`, Hugo will use every settings from `config/_default` and merge `staging`'s on top of those.
   80 {{% note %}}
   81 Default environments are __development__ with `hugo server` and __production__ with `hugo`.
   82 {{%/ note %}}
   83 
   84 ## Merge Configuration from Themes
   85 
   86 {{< new-in "0.84.0" >}} The configuration merge described below was improved in Hugo 0.84.0 and made fully configurable. The big change/improvement was that we now, by default, do deep merging of `params` maps from themes.
   87 
   88 The configuration value for `_merge` can be one of:
   89 
   90 none
   91 : No merge.
   92 
   93 shallow
   94 : Only add values for new keys.
   95 
   96 deep
   97 : Add values for new keys, merge existing.
   98 
   99 Note that you don't need to be so verbose as in the default setup below; a `_merge` value higher up will be inherited if not set.
  100 
  101 {{< code-toggle config="mergeStrategy" skipHeader=true />}}
  102 
  103 ## All Configuration Settings
  104 
  105 The following is the full list of Hugo-defined variables with their default
  106 value in parentheses. Users may choose to override those values in their site
  107 config file(s).
  108 
  109 ### archetypeDir 
  110 
  111 **Default value:** "archetypes"
  112 
  113 The directory where Hugo finds archetype files (content templates). {{% module-mounts-note %}}
  114 
  115 ### assetDir
  116 
  117 **Default value:** "assets"
  118 
  119 The directory where Hugo finds asset files used in [Hugo Pipes](/hugo-pipes/). {{% module-mounts-note %}}
  120 
  121 ### baseURL
  122 Hostname (and path) to the root, e.g. https://bep.is/
  123 
  124 ### build
  125 See [Configure Build](#configure-build)
  126 
  127 ### buildDrafts (false)
  128 
  129 **Default value:** false
  130 
  131 Include drafts when building.
  132 
  133 ### buildExpired
  134 
  135 **Default value:** false
  136 
  137 Include content already expired.
  138 
  139 ### buildFuture
  140 
  141 **Default value:** false
  142 
  143 Include content with publishdate in the future.
  144 
  145 ### caches
  146 See [Configure File Caches](#configure-file-caches)
  147 
  148 ### cascade
  149 
  150 {{< new-in "0.86.0" >}}
  151 
  152 Pass down down default configuration values (front matter) to pages in the content tree. The options in site config is the same as in page front matter, see [Front Matter Cascade](/content-management/front-matter#front-matter-cascade).
  153 
  154 ### canonifyURLs
  155 
  156 **Default value:** false
  157 
  158 Enable to turn relative URLs into absolute.
  159 
  160 ### contentDir
  161 
  162 **Default value:** "content"
  163 
  164 The directory from where Hugo reads content files. {{% module-mounts-note %}}
  165 
  166 ### copyright
  167 
  168 **Default value:** ""
  169 
  170 Copyright notice for your site, typically displayed in the footer.
  171 
  172 ### dataDir
  173 
  174 **Default value:** "data"
  175 
  176 The directory from where Hugo reads data files. {{% module-mounts-note %}}
  177 
  178 ### defaultContentLanguage
  179 
  180 **Default value:** "en"
  181 
  182 Content without language indicator will default to this language.
  183 
  184 ### defaultContentLanguageInSubdir
  185 
  186 **Default value:**  false
  187 
  188 Render the default content language in subdir, e.g. `content/en/`. The site root `/` will then redirect to `/en/`.
  189 
  190 ### disableAliases
  191 
  192 **Default value:**  false
  193 
  194 Will disable generation of alias redirects. Note that even if `disableAliases` is set, the aliases themselves are preserved on the page. The motivation with this is to be able to generate 301 redirects in an `.htaccess`, a Netlify `_redirects` file or similar using a custom output format.
  195 
  196 ### disableHugoGeneratorInject
  197 
  198 **Default value:**  false
  199 
  200 Hugo will, by default, inject a generator meta tag in the HTML head on the _home page only_. You can turn it off, but we would really appreciate if you don't, as this is a good way to watch Hugo's popularity on the rise.
  201 
  202 ### disableKinds
  203 
  204 **Default value:**  []
  205 
  206 Enable disabling of all pages of the specified *Kinds*. Allowed values in this list: `"page"`, `"home"`, `"section"`, `"taxonomy"`, `"term"`, `"RSS"`, `"sitemap"`, `"robotsTXT"`, `"404"`.
  207 
  208 ### disableLiveReload
  209 
  210 **Default value:**  false
  211 
  212 Disable automatic live reloading of browser window.
  213 
  214 ### disablePathToLower
  215 
  216 **Default value:**  false
  217 
  218 : Do not convert the url/path to lowercase.
  219 
  220 ### enableEmoji
  221 
  222 **Default value:**  false
  223 
  224 Enable Emoji emoticons support for page content; see the [Emoji Cheat Sheet](https://www.webpagefx.com/tools/emoji-cheat-sheet/).
  225 
  226 ### enableGitInfo
  227 
  228 **Default value:**  false
  229 
  230 Enable `.GitInfo` object for each page (if the Hugo site is versioned by Git). This will then update the `Lastmod` parameter for each page using the last git commit date for that content file.
  231 
  232 ### enableInlineShortcodes
  233 
  234 **Default value:**  false
  235 
  236 Enable inline shortcode support. See [Inline Shortcodes](/templates/shortcode-templates/#inline-shortcodes).
  237 
  238 ### enableMissingTranslationPlaceholders
  239 
  240 **Default value:**  false
  241 
  242 Show a placeholder instead of the default value or an empty string if a translation is missing.
  243 
  244 ### enableRobotsTXT
  245 
  246 **Default value:**  false
  247 
  248 Enable generation of `robots.txt` file.
  249 
  250 ### frontmatter
  251 
  252 See [Front matter Configuration](#configure-front-matter).
  253 
  254 ### googleAnalytics
  255 
  256 **Default value:**  ""
  257 
  258 Google Analytics tracking ID.
  259 
  260 ### hasCJKLanguage
  261 
  262 **Default value:** false
  263 
  264 If true, auto-detect Chinese/Japanese/Korean Languages in the content. This will make `.Summary` and `.WordCount` behave correctly for CJK languages.
  265 
  266 ### imaging
  267 
  268 See [Image Processing Config](/content-management/image-processing/#imaging-configuration).
  269 
  270 ### languageCode
  271 
  272 **Default value:**  ""
  273 
  274 A language tag as defined by [RFC 5646](https://datatracker.ietf.org/doc/html/rfc5646). The internal [RSS template](https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/_default/rss.xml) populates its `<language>` element with this value. The value is not used elsewhere.
  275 
  276 ### languages
  277 
  278 See [Configure Languages](/content-management/multilingual/#configure-languages).
  279 
  280 ### disableLanguages
  281 
  282 See [Disable a Language](/content-management/multilingual/#disable-a-language)
  283 
  284 ### markup
  285 See [Configure Markup](/getting-started/configuration-markup).{{< new-in "0.60.0" >}}
  286 
  287 ### mediaTypes
  288 See [Configure Media Types](/templates/output-formats/#media-types).
  289 
  290 ### menus
  291 See [Add Non-content Entries to a Menu](/content-management/menus/#add-non-content-entries-to-a-menu).
  292 
  293 ### minify
  294 See [Configure Minify](#configure-minify)
  295 
  296 ### module
  297 Module config see [Module Config](/hugo-modules/configuration/).{{< new-in "0.56.0" >}}
  298 
  299 ### newContentEditor
  300 
  301 **Default value:** ""
  302 
  303 The editor to use when creating new content.
  304 
  305 ### noChmod
  306 
  307 **Default value:** false
  308 
  309 Don't sync permission mode of files.
  310 
  311 ### noTimes
  312 
  313 **Default value:** false
  314 
  315 Don't sync modification time of files.
  316 
  317 ### outputFormats
  318 See [Configure Output Formats](#configure-additional-output-formats).
  319 
  320 ### paginate
  321 
  322 **Default value:** 10
  323 
  324 Default number of elements per page in [pagination](/templates/pagination/).
  325 
  326 ### paginatePath
  327 
  328 **Default value:** "page"
  329 
  330 The path element used during pagination (`https://example.com/page/2`).
  331 
  332 ### permalinks
  333 See [Content Management](/content-management/urls/#permalinks).
  334 
  335 ### pluralizeListTitles
  336 
  337 **Default value:** true
  338 
  339 Pluralize titles in lists.
  340 
  341 ### publishDir
  342 
  343 **Default value:** "public"
  344 
  345 The directory to where Hugo will write the final static site (the HTML files etc.).
  346 
  347 ### related
  348 : See [Related Content](/content-management/related/#configure-related-content).{{< new-in "0.27" >}}
  349 
  350 ### relativeURLs 
  351 
  352 **Default value:** false
  353 
  354 Enable this to make all relative URLs relative to content root. Note that this does not affect absolute URLs.
  355 
  356 ### refLinksErrorLevel
  357 
  358 **Default value:** "ERROR"
  359 
  360 When using `ref` or `relref` to resolve page links and a link cannot resolved, it will be logged with this log level. Valid values are `ERROR` (default) or `WARNING`. Any `ERROR` will fail the build (`exit -1`).
  361 
  362 ### refLinksNotFoundURL
  363 URL to be used as a placeholder when a page reference cannot be found in `ref` or `relref`. Is used as-is.
  364 
  365 ### removePathAccents
  366 
  367 **Default value:** false
  368 
  369 Removes [non-spacing marks](https://www.compart.com/en/unicode/category/Mn) from [composite characters](https://en.wikipedia.org/wiki/Precomposed_character) in content paths.
  370 
  371 ```text
  372 content/post/hügó.md --> https://example.org/post/hugo/
  373 ```
  374 
  375 
  376 ### rssLimit
  377 
  378 **Default value:** -1 (unlimited)
  379 
  380 Maximum number of items in the RSS feed.
  381 
  382 ### sectionPagesMenu
  383 See ["Section Menu for Lazy Bloggers"](/templates/menu-templates/#section-menu-for-lazy-bloggers).
  384 
  385 ### security
  386 
  387 See [Security Policy](/about/security-model/#security-policy)
  388 
  389 ### sitemap
  390 Default [sitemap configuration](/templates/sitemap-template/#configuration).
  391 
  392 ### summaryLength
  393 
  394 **Default value:** 70
  395 
  396 The length of text in words to show in a [`.Summary`](/content-management/summaries/#automatic-summary-splitting).
  397 
  398 ### taxonomies
  399 See [Configure Taxonomies](/content-management/taxonomies#configure-taxonomies).
  400 
  401 ### theme
  402 : See [Module Config](/hugo-modules/configuration/#module-config-imports) for how to import a theme.
  403 
  404 ### themesDir
  405 
  406 **Default value:**  "themes"
  407 
  408 The directory where Hugo reads the themes from.
  409 
  410 ### timeout 
  411 
  412 **Default value:** "30s"
  413 
  414 Timeout for generating page contents, specified as a [duration](https://pkg.go.dev/time#Duration) or in milliseconds. *Note:*&nbsp;this is used to bail out of recursive content generation. You might need to raise this limit if your pages are slow to generate (e.g., because they require large image processing or depend on remote contents).
  415 
  416 ### timeZone 
  417 
  418 {{< new-in "0.87.0" >}}
  419 
  420 The time zone (or location), e.g. `Europe/Oslo`,  used to parse front matter dates without such information and in the [`time` function](/functions/time/). The list of valid values may be system dependent, but should include `UTC`, `Local`, and any location in the [IANA Time Zone database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
  421 
  422 ### title
  423 Site title.
  424 
  425 ### titleCaseStyle
  426 
  427 **Default value:**  "AP"
  428 
  429 See [Configure Title Case](#configure-title-case)
  430 
  431 ### uglyURLs
  432 When enabled, creates URL of the form `/filename.html` instead of `/filename/`.
  433 
  434 ### watch
  435 
  436 **Default value:** false
  437 
  438 Watch filesystem for changes and recreate as needed.
  439 
  440 {{% note %}}
  441 If you are developing your site on a \*nix machine, here is a handy shortcut for finding a configuration option from the command line:
  442 ```
  443 cd ~/sites/yourhugosite
  444 hugo config | grep emoji
  445 ```
  446 
  447 which shows output like
  448 
  449 ```
  450 enableemoji: true
  451 ```
  452 {{% /note %}}
  453 
  454 ## Configure Build
  455 
  456 {{< new-in "0.66.0" >}}
  457 
  458 The `build` configuration section contains global build-related configuration options.
  459 
  460 {{< code-toggle file="config">}}
  461 [build]
  462 useResourceCacheWhen="fallback"
  463 writeStats = false
  464 noJSConfigInAssets = false
  465 {{< /code-toggle >}}
  466 
  467 
  468 useResourceCacheWhen
  469 : When to use the cached resources in `/resources/_gen` for PostCSS and ToCSS. Valid values are `never`, `always` and `fallback`. The last value means that the cache will be tried if PostCSS/extended version is not available.
  470 
  471 writeStats {{< new-in "0.69.0" >}}
  472 : When enabled, a file named `hugo_stats.json` will be written to your project root with some aggregated data about the build, e.g. list of HTML entities published to be used to do [CSS pruning](/hugo-pipes/postprocess/#css-purging-with-postcss). If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory). It's also worth mentioning that, due to the nature of the partial server builds, new HTML entities will be added when you add or change them while the server is running, but the old values will not be removed until you restart the server or run a regular `hugo` build.
  473 
  474 **Note** that the prime use case for this is purging of unused CSS; it is build for speed and there may be false positives (e.g. elements that isn't really a HTML element).
  475 
  476 noJSConfigInAssets {{< new-in "0.78.0" >}}
  477 : Turn off writing a `jsconfig.json` into your `/assets` folder with mapping of imports from running [js.Build](https://gohugo.io/hugo-pipes/js). This file is intended to help with intellisense/navigation inside code editors such as [VS Code](https://code.visualstudio.com/). Note that if you do not use `js.Build`, no file will be written.
  478 
  479 ## Configure Server
  480 
  481 {{< new-in "0.67.0" >}}
  482 
  483 This is only relevant when running `hugo server`, and it allows to set HTTP headers during development, which allows you to test out your Content Security Policy and similar. The configuration format matches [Netlify's](https://docs.netlify.com/routing/headers/#syntax-for-the-netlify-configuration-file) with slightly more powerful [Glob matching](https://github.com/gobwas/glob):
  484 
  485 
  486 {{< code-toggle file="config">}}
  487 [server]
  488 [[server.headers]]
  489 for = "/**"
  490 
  491 [server.headers.values]
  492 X-Frame-Options = "DENY"
  493 X-XSS-Protection = "1; mode=block"
  494 X-Content-Type-Options = "nosniff"
  495 Referrer-Policy = "strict-origin-when-cross-origin"
  496 Content-Security-Policy = "script-src localhost:1313"
  497 {{< /code-toggle >}}
  498 
  499 Since this is is "development only", it may make sense to put it below the `development` environment:
  500 
  501 
  502 {{< code-toggle file="config/development/server">}}
  503 [[headers]]
  504 for = "/**"
  505 
  506 [headers.values]
  507 X-Frame-Options = "DENY"
  508 X-XSS-Protection = "1; mode=block"
  509 X-Content-Type-Options = "nosniff"
  510 Referrer-Policy = "strict-origin-when-cross-origin"
  511 Content-Security-Policy = "script-src localhost:1313"
  512 {{< /code-toggle >}}
  513 
  514 
  515 {{< new-in "0.72.0" >}}
  516 
  517 You can also specify simple redirects rules for the server. The syntax is again similar to Netlify's. 
  518 
  519 Note that a `status` code of 200 will trigger a [URL rewrite](https://docs.netlify.com/routing/redirects/rewrites-proxies/), which is what you want in SPA situations, e.g:
  520 
  521 {{< code-toggle file="config/development/server">}}
  522 [[redirects]]
  523 from = "/myspa/**"
  524 to = "/myspa/"
  525 status = 200
  526 force = false
  527 {{< /code-toggle >}}
  528 
  529 {{< new-in "0.76.0" >}} Setting `force=true` will make a redirect even if there is existing content in the path. Note that before Hugo 0.76  `force` was the default behaviour, but this is inline with how Netlify does it.
  530 
  531 ## Configure Title Case
  532 
  533 Set `titleCaseStyle` to specify the title style used by the [title](/functions/title/) template function and the automatic section titles in Hugo. It defaults to [AP Stylebook](https://www.apstylebook.com/) for title casing, but you can also set it to `Chicago` or `Go` (every word starts with a capital letter).
  534 
  535 ## Configuration Environment Variables
  536 
  537 HUGO_NUMWORKERMULTIPLIER
  538 : Can be set to increase or reduce the number of workers used in parallel processing in Hugo. If not set, the number of logical CPUs will be used.
  539 
  540 ## Configuration Lookup Order
  541 
  542 Similar to the template [lookup order][], Hugo has a default set of rules for searching for a configuration file in the root of your website's source directory as a default behavior:
  543 
  544 1. `./config.toml`
  545 2. `./config.yaml`
  546 3. `./config.json`
  547 
  548 In your `config` file, you can direct Hugo as to how you want your website rendered, control your website's menus, and arbitrarily define site-wide parameters specific to your project.
  549 
  550 
  551 ## Example Configuration
  552 
  553 The following is a typical example of a configuration file. The values nested under `params:` will populate the [`.Site.Params`][] variable for use in [templates][]:
  554 
  555 {{< code-toggle file="config">}}
  556 baseURL: "https://yoursite.example.com/"
  557 title: "My Hugo Site"
  558 permalinks:
  559   posts: /:year/:month/:title/
  560 params:
  561   Subtitle: "Hugo is Absurdly Fast!"
  562   AuthorName: "Jon Doe"
  563   GitHubUser: "spf13"
  564   ListOfFoo:
  565     - "foo1"
  566     - "foo2"
  567   SidebarRecentLimit: 5
  568 {{< /code-toggle >}}
  569 
  570 ## Configure with Environment Variables
  571 
  572 In addition to the 3 config options already mentioned, configuration key-values can be defined through operating system environment variables.
  573 
  574 For example, the following command will effectively set a website's title on Unix-like systems:
  575 
  576 ```
  577 $ env HUGO_TITLE="Some Title" hugo
  578 ```
  579 
  580 This is really useful if you use a service such as Netlify to deploy your site. Look at the Hugo docs [Netlify configuration file](https://github.com/gohugoio/hugoDocs/blob/master/netlify.toml) for an example.
  581 
  582 {{% note "Setting Environment Variables" %}}
  583 Names must be prefixed with `HUGO_` and the configuration key must be set in uppercase when setting operating system environment variables.
  584 
  585 To set config params, prefix the name with `HUGO_PARAMS_`
  586 {{% /note %}}
  587 
  588 {{< new-in "0.79.0" >}} If you are using snake_cased variable names, the above will not work, so since Hugo 0.79.0 Hugo determines the delimiter to use by the first character after `HUGO`. This allows you to define environment variables on the form `HUGOxPARAMSxAPI_KEY=abcdefgh`, using any [allowed](https://stackoverflow.com/questions/2821043/allowed-characters-in-linux-environment-variable-names#:~:text=So%20names%20may%20contain%20any,not%20begin%20with%20a%20digit.) delimiter.
  589 
  590 {{< todo >}}
  591 Test and document setting params via JSON env var.
  592 {{< /todo >}}
  593 
  594 ## Ignore Content and Data Files when Rendering
  595 
  596 To exclude specific files from the `content` and `data` directories when rendering your site, set `ignoreFiles` to one or more regular expressions to match against the absolute file path.
  597 
  598 To ignore files ending with `.foo` or `.boo`:
  599 
  600 {{< code-toggle copy="false" >}}
  601 ignoreFiles = ['\.foo$', '\.boo$']
  602 {{< /code-toggle >}}
  603 
  604 To ignore a file using the absolute file path:
  605 
  606 {{< code-toggle copy="false" >}}
  607 ignoreFiles = ['^/home/user/project/content/test\.md$']
  608 {{< /code-toggle >}}
  609 
  610 ## Configure Front Matter
  611 
  612 ### Configure Dates
  613 
  614 Dates are important in Hugo, and you can configure how Hugo assigns dates to your content pages. You do this by adding a `frontmatter` section to your `config.toml`.
  615 
  616 
  617 The default configuration is:
  618 
  619 {{< code-toggle file="config" >}}
  620 [frontmatter]
  621 date = ["date", "publishDate", "lastmod"]
  622 lastmod = [":git", "lastmod", "date", "publishDate"]
  623 publishDate = ["publishDate", "date"]
  624 expiryDate = ["expiryDate"]
  625 {{< /code-toggle >}}
  626 
  627 If you, as an example, have a non-standard date parameter in some of your content, you can override the setting for `date`:
  628 
  629 {{< code-toggle file="config" >}}
  630 [frontmatter]
  631 date = ["myDate", ":default"]
  632 {{< /code-toggle >}}
  633 
  634 The `:default` is a shortcut to the default settings. The above will set `.Date` to the date value in `myDate` if present, if not we will look in `date`,`publishDate`, `lastmod` and pick the first valid date.
  635 
  636 In the list to the right, values starting with ":" are date handlers with a special meaning (see below). The others are just names of date parameters (case insensitive) in your front matter configuration.  Also note that Hugo have some built-in aliases to the above: `lastmod` => `modified`, `publishDate` => `pubdate`, `published` and `expiryDate` => `unpublishdate`. With that, as an example, using `pubDate` as a date in front matter, will, by default, be assigned to `.PublishDate`.
  637 
  638 The special date handlers are:
  639 
  640 
  641 `:fileModTime`
  642 : Fetches the date from the content file's last modification timestamp.
  643 
  644 An example:
  645 
  646 {{< code-toggle file="config" >}}
  647 [frontmatter]
  648 lastmod = ["lastmod", ":fileModTime", ":default"]
  649 {{< /code-toggle >}}
  650 
  651 
  652 The above will try first to extract the value for `.Lastmod` starting with the `lastmod` front matter parameter, then the content file's modification timestamp. The last, `:default` should not be needed here, but Hugo will finally look for a valid date in `:git`, `date` and then `publishDate`.
  653 
  654 
  655 `:filename`
  656 : Fetches the date from the content file's filename. For example, `2018-02-22-mypage.md` will extract the date `2018-02-22`. Also, if `slug` is not set, `mypage` will be used as the value for `.Slug`.
  657 
  658 An example:
  659 
  660 {{< code-toggle file="config" >}}
  661 [frontmatter]
  662 date  = [":filename", ":default"]
  663 {{< /code-toggle >}}
  664 
  665 The above will try first to extract the value for `.Date` from the filename, then it will look in front matter parameters `date`, `publishDate` and lastly `lastmod`.
  666 
  667 
  668 `:git`
  669 : This is the Git author date for the last revision of this content file. This will only be set if `--enableGitInfo` is set or `enableGitInfo = true` is set in site config.
  670 
  671 ## Configure Additional Output Formats
  672 
  673 Hugo v0.20 introduced the ability to render your content to multiple output formats (e.g., to JSON, AMP html, or CSV). See [Output Formats][] for information on how to add these values to your Hugo project's configuration file.
  674 
  675 ## Configure Minify
  676 
  677 {{< new-in "0.68.0" >}}
  678 
  679 Default configuration:
  680 
  681 {{< code-toggle config="minify" />}}
  682 
  683 ## Configure File Caches
  684 
  685 Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the default configuration:
  686 
  687 {{< code-toggle >}}
  688 [caches]
  689 [caches.getjson]
  690 dir = ":cacheDir/:project"
  691 maxAge = -1
  692 [caches.getcsv]
  693 dir = ":cacheDir/:project"
  694 maxAge = -1
  695 [caches.getresource]
  696 dir = ":cacheDir/:project"
  697 maxAge = -1
  698 [caches.images]
  699 dir = ":resourceDir/_gen"
  700 maxAge = -1
  701 [caches.assets]
  702 dir = ":resourceDir/_gen"
  703 maxAge = -1
  704 [caches.modules]
  705 dir = ":cacheDir/modules"
  706 maxAge = -1
  707 {{< /code-toggle >}}
  708 
  709 You can override any of these cache settings in your own `config.toml`.
  710 
  711 ### The keywords explained
  712 
  713 `:cacheDir`
  714 : This is the value of the `cacheDir` config option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache` directory below the OS temp dir for the others. 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 vendors, please read their documentation. For an CircleCI example, see [this configuration](https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml).
  715 
  716 `:project`
  717 : The base directory name of the current Hugo project. This means that, in its default setting, every project will have separated file caches, which means that when you do `hugo --gc` you will not touch files related to other Hugo projects running on the same PC.
  718 
  719 `:resourceDir`
  720 : This is the value of the `resourceDir` config option.
  721 
  722 maxAge
  723 : This is the duration before a cache entry will be evicted, -1 means forever and 0 effectively turns that particular cache off. Uses Go's `time.Duration`, so valid values are `"10s"` (10 seconds), `"10m"` (10 minutes) and `"10h"` (10 hours).
  724 
  725 dir
  726 : The absolute path to where the files for this cache will be stored. Allowed starting placeholders are `:cacheDir` and `:resourceDir` (see above).
  727 
  728 ## Configuration Format Specs
  729 
  730 * [TOML Spec][toml]
  731 * [YAML Spec][yaml]
  732 * [JSON Spec][json]
  733 
  734 [`.Site.Params`]: /variables/site/
  735 [directory structure]: /getting-started/directory-structure
  736 [json]: https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf "Specification for JSON, JavaScript Object Notation"
  737 [lookup order]: /templates/lookup-order/
  738 [Output Formats]: /templates/output-formats/
  739 [templates]: /templates/
  740 [toml]: https://github.com/toml-lang/toml
  741 [yaml]: https://yaml.org/spec/
  742 [static-files]: /content-management/static-files/