pywb icon indicating copy to clipboard operation
pywb copied to clipboard

Dependencies of per-collection templates

Open despens opened this issue 2 years ago • 1 comments
trafficstars

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

  1. Start out with new pywb 2.7 install.
  2. Initialize a new collection test via wb-manager init test
  3. Create custom error message for the collection via wb-manager template --add not_found_html
  4. files base.html and not_found.html appear in collections/test/templates/.
  5. Request page in collection that does not exist, for instance http://localhost/8080/test/wobble-wobble.html
  6. pywb shows unstyled error page
  7. remove collections/test/templates/base.html
  8. reload pywb page
  9. 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.

despens avatar Mar 30 '23 10:03 despens

I'm hitting this error too with 2.7.4.

ruebot avatar Sep 24 '23 23:09 ruebot