It would be useful to access the file path of a page resource. One use case would be to pass the resource path into os.Stat to check the file size, and return a resized image if the original resource is an image greater than a certain file size.
Unless I’m mistaken, the only workaround for this is to have permalinks match the structure of the content directory and pass $resource.RelPermalink. This only works if the permalink matches the relative path of the file in the content directory ( pretty hacky ).
I don’t believe that .File is a field on Resource (in fact I just tested it). Is there an undocumented way to capture the file info (that includes the path) of a resource?