HUGO
Getting a filename without the extension
support
jmooring
March 5, 2022, 1:15am
2
{{ strings.TrimSuffix (path.Ext .Name) .Name }}
References:
https://gohugo.io/content-management/page-resources/#properties
https://gohugo.io/functions/strings.trimsuffix
https://gohugo.io/functions/path.ext
Hugo Tutorials & Tips
show post in topic
Related topics
Topic
Replies
Views
Activity
Just get the base filename using page resources metadata
support
3
1064
March 11, 2021
How to trim extention of image file?
support
2
379
May 18, 2022
Trim string from param
support
2
514
July 16, 2019
Original filename of named page resource?
support
3
392
August 18, 2022
Get extension of file name?
support
7
4298
April 10, 2019