mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
resources/page: Add :contentbasename and :contentbasenameorslug permalink tokens
See #11722
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
157d3703c3
commit
cb7a4339b7
@@ -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
|
||||
|
Reference in New Issue
Block a user