Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR aims to solve a long running problem where Glide URLs in a subdirectory based site would have the subdirectory in it, causing 404s.
e.g. You have
/
and/fr
set up as sites.Generate an image on /, you get something like
/img/image.jpg
, which works.Generate one on
/fr
, you get something like/fr/img/image.jpg
, which 404s because there's no Glide route at/fr/img
.A solution was to use symlinks, which always felt quite hacky, and only really worked when using the cached setup. As pointed out in this comment, adding a symlink would break the root url anyway.
This PR now makes the Glide routes available for every subdirectory-based site.
When using cached mode, the URLs will always be from the top level.
Unrelated to multisite, it also removes the Glide routes entirely if the cached option is being used, since the images get generated on demand in your template and the actual images get served.
Closes #1953
Closes #1304