-
Notifications
You must be signed in to change notification settings - Fork 212
Refactor static file handling #1090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Moved the static files out of templates/ and src/ (both as static files that got included in the build, and as static strings in the source) into the static/ directory * Copied the static/ directory into the docker image as static/ * Removed the `staticfile` handler serving from $CRATESFYI_PREFIX/public_html/ since those files are now in static/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, I want to play around with it a little more and make sure it behaves the same. Thanks for working on this!
src/web/routes.rs
Outdated
"/opensearch.xml", | ||
PermanentRedirect("/-/static/opensearch.xml"), | ||
); | ||
routes.static_resource("/sitemap.xml", PermanentRedirect("/-/sitemap.xml")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sitemap has to live at the top level:
A sitemap can be posted anywhere on your site, but a sitemap affects only descendants of the parent directory. Therefore, a sitemap posted at the site root can affect all files on the site, which is where we recommend posting your sitemaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, that was one I was wondering about, I'll change this back and put in a comment.
Moved the static files out of templates/ and src/ (both as static files that got included in the build, and as static strings in the source) into the static/ directory
Copied the static/ directory into the docker image as static/
Removed the
staticfile
handler serving from $CRATESFYI_PREFIX/public_html/ since those files are now in static/Add metrics tracking DatabaseFileHandler usage
Fixes #55