First, I’m new to Hugo and teaching myself, so I apologize in advance.
I have a page bundle of images. What I’d like to do is display each image and have it link to a corresponding PDF. The PDF are named the same as the images, so image1.jpg corresponds to image1.pdf. image2.jpg to image2.pdf, etc.
I modified the list layout so I have each image as a link, but using the .Name or .Title resource includes the entire filename - so image1.jpg links to image1.jpg.pdf. I’d like to be able just have the filename, but I’m not sure how to do that. I’ve looked into pattern matching here - Page Resources | Hugo - and it feels like this is the solution, but I don’t know how strip the file extension. So in my _index.md, I have:
resources:
- title: CODE TO JUST GET THE BASE PATH OF FILE
params:
src: '**.jpg'
What do I need to do?