Simplifying and Unifying Static File Handling #368
Merged
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 introduces changes to make static file management more consistent, intuitive, and easier to understand.
Before this, it wasn't possible to add static files directly to the root directory, which could cause issues (e.g., adding an HTML file for Google Search registration). This update addresses that limitation while unifying and simplifying related behaviours.
Key Changes:
page.attachment()
andsite.staticFile()
have been renamed topage.file()
andsite.file()
for simplicity and consistency.public/
as the directory for static files.public/static/
will reproduce the same behavior as/static
.static/
directory is still scanned for compatibility.images
(e.g.,public/images/foo.png
) instead ofstatic/assets/images
for simplicity.static/assets/images
directory is still checked to support older sites.page.file()
on non-directory pages now throws an error.page.image()
on a directory page will no longer fallback to site images if the image is not found; it will now throw an error.These changes aim to simplify static file handling while maintaining backward compatibility where possible.