Issue with direct links to files in Folder

Pardon if this is a repost. I searched but could not find a solution. I have a page created for a project of mine. It is located in user/pages/05.project/photographs-of-saint-john/

in this folder I have another folder containing images with a sub folder for /thumbs/ and /full/ which are for the projects thumbnails and full size images.

Now if i link to a thumbnail file directly for example :

It gives me the same image as if I goto the full size version here :

I am not sure if I cannot use direct links within grav like above or perhaps should be sticking to using {{ relative_url }}?

Any help or lead would be appreciated!

That’s interesting. Something is definitely up there. It’s related to this ‘fallback’ functionality we have when a Grav route is not found.

Basically URLs in the user folder are a routed as pages first. Then if that page is not found, we make an attempt to see if you were trying to reference a file that exists. I will look at this logic to see if anything is amiss that could be causing this problem you are seeing.

An alternative would be to setup a directory at the root of grav that would not be routed, for example /project-images and just reference those images directly with via /project-images/project-x/image-1.jpg

However, what you are trying to do is not ideal. The better solution would be to put the images in the folder directly with the page. Then you could use Grav’s media capabilities to dynamically create the thumbnail as needed.

Unless you have some good reason not to use Grav’s built in image hand ling, I strongly suggest doing so as it will automatically route to the image without any pathing needed, and gives you complete control over manipulating that image without the need of pre-processing it manually.

Ok. I will try that out then. Thanks,

FYI, if you were to drop an image called “image-x.jpg” into the your user/pages/05.project/photographs-of-saint-john/ folder, from your page you could access it directly and resize it to a thumbnail like this:


The Media Page on has many more examples of the kinds of things you can do.

Awesome. Thus eliminating my need for thumbnails. Good idea. Thanks!