From 1ad28e1e0e1aa06725265bf3f117300d5116143c Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Tue, 15 Oct 2024 07:08:49 -0700 Subject: [PATCH] Describe how to configure uglyURLs per section --- content/en/content-management/urls.md | 8 ++++++++ content/en/getting-started/configuration.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/content/en/content-management/urls.md b/content/en/content-management/urls.md index 0e3fa297bd..0d67edb262 100644 --- a/content/en/content-management/urls.md +++ b/content/en/content-management/urls.md @@ -311,6 +311,14 @@ By default, Hugo produces pretty URLs. To generate ugly URLs, change your site c uglyURLs = true {{< /code-toggle >}} +You can also enable uglyURLs by section. For example, with a site that contains sections for books and films: + +{{< code-toggle file=hugo >}} +[uglyURLs] +books = true +films = false +{{< /code-toggle >}} + ### Post-processing Hugo provides two mutually exclusive configuration options to alter URLs _after_ it renders a page. diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index df6309eb38..a242c32717 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -536,7 +536,7 @@ See [module configuration](/hugo-modules/configuration/#module-configuration-imp ###### uglyURLs -(`bool`) When enabled, creates URL of the form `/filename.html` instead of `/filename/`. Default is `false`. +(`bool` or `map`) Whether to generate uglyURLs. Default is `false`. See [details](/content-management/urls/#appearance). ###### watch