Sounds like Suggestion: Ability to rename page resources intended for download - #4
Unfortunately, no solution to the actual question was given there (IMO).
My use case:
- I have a blog with travel reports and photos
- For the sake of simplicity, I put original photos (hi-res, 2-5 Mb each) directly next to my post content. Similarly to the topicstarter of the linked question, the filenames in my filesystem are for for myself only. Example:
|posts
-|2022-my-mega-post
--|index.md
--|2022-01-01 21.22.35.jpg
--|2022-01-02 11.22.35.jpg
- In my post I had my
img
shortcode which is capable of renaming the images to something more human-readable/seo-friendly/whatever, like{{< img "2024-08-15 16.21.04.jpg" "vennbahn-map" "Vennbahn Map" >}}
where the second param is the intented filename (vennbahn-map.jpg
) and the third is caption
And now goes the problem - basically when I do Resource Copy
and copy the image to the new name… It obviously does copy, so it leaves me with basically 2x copies of the files in the resulted public
Hugo folder.
Is there a way to remove the original resource from public
after copying?