Skip to content

Commit

Permalink
Describe how to configure uglyURLs per section
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring authored Oct 15, 2024
1 parent cbbd4c4 commit 1ad28e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions content/en/content-management/urls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion content/en/getting-started/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1ad28e1

Please sign in to comment.