]> git.maquefel.me Git - brevno-suite/hugo/commit
resources/page: Revise the new contentbasename permalinks tokens
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 12 Feb 2025 21:36:24 +0000 (22:36 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 17 Feb 2025 08:41:49 +0000 (09:41 +0100)
commit7b7a0f3624c8b12fdd4b469ef15c02c5a7acb61b
tree204f8e5868ad95e51a6f537044590d084d2f98b0
parentcb7a4339b74519836be41e43e6bffef64606420b
resources/page: Revise the new contentbasename permalinks tokens

* Make it work for all pages, including those created from content adapters and not backed by a file.
* Allow the `slug` to win, so the new tokens are:

`:contentbasename`:

1. ContentBaseName

`:slugorcontentbasename`:

1. Slug
2. ContentBaseName

Note that a page will always have a `ContentBaseName`, so no need to fall back to e.g. the title.

Closes #11722
docs/content/en/content-management/urls.md
resources/page/permalinks.go
resources/page/permalinks_integration_test.go
resources/page/permalinks_test.go
resources/page/testhelpers_test.go
source/fileInfo.go