diff --git a/content/en/content-management/image-processing/index.md b/content/en/content-management/image-processing/index.md index 273b68ab8..37c151c75 100644 --- a/content/en/content-management/image-processing/index.md +++ b/content/en/content-management/image-processing/index.md @@ -384,14 +384,7 @@ Note the self-closing shortcode syntax above. You may call the `imgproc` shortco Define an `imaging` section in your site configuration to set the default [image processing options](#image-processing-options). -{{< code-toggle file="hugo" copy=true >}} -[imaging] -resampleFilter = "Box" -quality = 75 -hint = "photo" -anchor = "Smart" -bgColor = "#ffffff" -{{< /code-toggle >}} +{{< code-toggle config="imaging" />}} anchor : See image processing options: [anchor](#anchor). diff --git a/content/en/content-management/multilingual.md b/content/en/content-management/multilingual.md index 849df681f..93e46e4a3 100644 --- a/content/en/content-management/multilingual.md +++ b/content/en/content-management/multilingual.md @@ -19,6 +19,10 @@ Also See [Hugo Multilingual Part 1: Content translation]. ## Configure languages +This is the default language configuration: + +{{< code-toggle config="languages" />}} + This is an example of a site configuration for a multilingual project. Any key not defined in a `languages` object will fall back to the global value in the root of your site configuration. {{< code-toggle file="hugo" >}} diff --git a/content/en/content-management/taxonomies.md b/content/en/content-management/taxonomies.md index 45b368c7f..14a467390 100644 --- a/content/en/content-management/taxonomies.md +++ b/content/en/content-management/taxonomies.md @@ -82,11 +82,7 @@ Hugo natively supports taxonomies. Without adding a single line to your [site configuration] file, Hugo will automatically create taxonomies for `tags` and `categories`. That would be the same as manually [configuring your taxonomies](#configure-taxonomies) as below: -{{< code-toggle file="hugo" copy=false >}} -[taxonomies] - tag = "tags" - category = "categories" -{{}} +{{< code-toggle config="taxonomies" />}} If you do not want Hugo to create any taxonomies, set `disableKinds` in your [site configuration] to the following: diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index 2ed46cb10..86fd311c2 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -491,28 +491,7 @@ enableemoji: true The `build` configuration section contains global build-related configuration options. -{{< code-toggle file="hugo" >}} -[build] - noJSConfigInAssets = false - useResourceCacheWhen = 'fallback' - [build.buildStats] - disableClasses = false - disableIDs = false - disableTags = false - enable = false -[[build.cachebusters]] - source = 'assets/.*\.(js|ts|jsx|tsx)' - target = '(js|scripts|javascript)' -[[build.cachebusters]] - source = 'assets/.*\.(css|sass|scss)$' - target = '(css|styles|scss|sass)' -[[build.cachebusters]] - source = '(postcss|tailwind)\.config\.js' - target = '(css|styles|scss|sass)' -[[build.cachebusters]] - source = 'assets/.*\.(.*)$' - target = '$1' -{{< /code-toggle >}} +{{< code-toggle config="build" />}} buildStats {{< new-in "0.115.1" >}} : When enabled, creates a `hugo_stats.json` file in the root of your project. This file contains arrays of the `class` attributes, `id` attributes, and tags of every HTML element within your published site. Use this file as data source when [removing unused CSS] from your site. This process is also known as pruning, purging, or tree shaking. @@ -735,13 +714,7 @@ Dates are important in Hugo, and you can configure how Hugo assigns dates to you The default configuration is: -{{< code-toggle file="hugo" >}} -[frontmatter] -date = ["date", "publishDate", "lastmod"] -lastmod = [":git", "lastmod", "date", "publishDate"] -publishDate = ["publishDate", "date"] -expiryDate = ["expiryDate"] -{{< /code-toggle >}} +{{< code-toggle config="frontmatter" />}} If you, as an example, have a non-standard date parameter in some of your content, you can override the setting for `date`: @@ -797,27 +770,7 @@ Default configuration: Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the default configuration: -{{< code-toggle file="hugo" >}} -[caches] -[caches.getjson] -dir = ":cacheDir/:project" -maxAge = -1 -[caches.getcsv] -dir = ":cacheDir/:project" -maxAge = -1 -[caches.getresource] -dir = ":cacheDir/:project" -maxAge = -1 -[caches.images] -dir = ":resourceDir/_gen" -maxAge = -1 -[caches.assets] -dir = ":resourceDir/_gen" -maxAge = -1 -[caches.modules] -dir = ":cacheDir/modules" -maxAge = -1 -{{< /code-toggle >}} +{{< code-toggle config="caches" />}} You can override any of these cache settings in your own `hugo.toml`. diff --git a/content/en/templates/output-formats.md b/content/en/templates/output-formats.md index d1f5f3bfe..23b0f1696 100644 --- a/content/en/templates/output-formats.md +++ b/content/en/templates/output-formats.md @@ -129,13 +129,7 @@ system. Every `Page` has a [`Kind`][page_kinds] attribute, and the default Output Formats are set based on that. -| Kind | Default Output Formats | -| ---------- | ---------------------- | -| `page` | HTML | -| `home` | HTML, RSS | -| `section` | HTML, RSS | -| `taxonomy` | HTML, RSS | -| `term` | HTML, RSS | +{{< code-toggle config="outputs" />}} ### Customizing output formats diff --git a/content/en/templates/sitemap-template.md b/content/en/templates/sitemap-template.md index 32299bf52..4f86380f1 100644 --- a/content/en/templates/sitemap-template.md +++ b/content/en/templates/sitemap-template.md @@ -27,12 +27,7 @@ With a multilingual project, Hugo generates: Set the default values for [change frequency] and [priority], and the name of the generated file, in your site configuration. -{{< code-toggle file="hugo" >}} -[sitemap] - changefreq = 'monthly' - filename = 'sitemap.xml' - priority = 0.5 -{{}} +{{< code-toggle config="sitemap" />}} changefreq : How frequently a page is likely to change. Valid values are `always`, `hourly`, `daily`, `weekly`, `monthly`, `yearly`, and `never`. Default is `""` (change frequency omitted from rendered sitemap).