pywb
pywb copied to clipboard
Dependencies of per-collection templates
When customizing a single template for a collection, for instance not_found.html, template dependencies are not resolved and lead to rendering or server errors.
Steps to reproduce the bug
- Start out with new pywb 2.7 install.
- Initialize a new collection
testviawb-manager init test - Create custom error message for the collection via
wb-manager template --add not_found_html - files
base.htmlandnot_found.htmlappear incollections/test/templates/. - Request page in collection that does not exist, for instance http://localhost/8080/test/wobble-wobble.html
- pywb shows unstyled error page
- remove
collections/test/templates/base.html - reload pywb page
- pywb responds with Internal Server Error
Expected behavior
The template should display correctly. Any template dependencies should be looked up in the current collection's templates directory, if not present fall back to the deployment's base template directory, and finally to pywb's distribution directory.
Otherwise it will be very hard to customize a single template for a collection, as that would mean to "fork" the whole template dependency chain. Curators would need to manage all templates for all collection after possible pywb updates.
I'm hitting this error too with 2.7.4.