Say I have an image resource called $img. Is there any way I can read the path of the image, without using .RelPermalink(it pushes the image to public, which I’d like to avoid).
The use case is using it as a variant for partialCached. If there’s another unique way to refer to an image resource, please let me know.
$img.Name is not a valid choice because two images(Page resources) will have the same .Name value based on the path relative to the page.
Thanks, I’ll test this and get back to you. By the way, is it there in the documentation somewhere? Because I couldn’t find anything like this even I searched earlier.
It’s in the GoDocs, so technically it’s in a documentation, but not on Gohugoio. It’s mostly meant for internal use, though, but once/if we get this done: New docs content structure · Issue #1 · gohugoio/gohugoioTheme2 · GitHub – then we should make sure that all the methods and functions are covered in the docs.