diff options
author | Henrique Dias <mail@hacdias.com> | 2025-02-12 14:13:17 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2025-02-17 09:41:49 +0100 |
commit | cb7a4339b74519836be41e43e6bffef64606420b (patch) | |
tree | 945bc92ddd7fc2606c1428de6cc005d9b1484556 /docs | |
parent | 157d3703c3ec7bd2b25270c55b0d6e6d203f76e3 (diff) | |
download | hugo-cb7a4339b74519836be41e43e6bffef64606420b.tar.gz hugo-cb7a4339b74519836be41e43e6bffef64606420b.zip |
resources/page: Add :contentbasename and :contentbasenameorslug permalink tokens
See #11722
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/en/content-management/urls.md | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/content/en/content-management/urls.md b/docs/content/en/content-management/urls.md index ab0c7148a..62ccfb666 100644 --- a/docs/content/en/content-management/urls.md +++ b/docs/content/en/content-management/urls.md @@ -317,6 +317,14 @@ Use these tokens when defining the URL pattern. You can also use these tokens wh `:slugorfilename` : The slug as defined in front matter, else the content's file name without extension, applicable to the `page` page kind. +`:contentbasename` +: The content base name, as defined in [`File.ContentBaseName`], applicable to pages backed by a file. + +`:contentbasenameorslug` +: The content base name, else the slug as defined above. + +[`File.ContentBaseName`]: /methods/page/file/#contentbasename + For time-related values, you can also use the layout string components defined in Go's [time package]. For example: [time package]: https://pkg.go.dev/time#pkg-constants |