fix: add custom url prefix if needed, for fanstatic

This commit is contained in:
Lance Edgar 2024-06-30 12:40:03 -05:00
parent 1dc632174e
commit 3f7de5872e

View file

@ -201,6 +201,9 @@ def get_liburl(request, key, fallback=True):
static = importlib.import_module(static) static = importlib.import_module(static)
needed = request.environ['fanstatic.needed'] needed = request.environ['fanstatic.needed']
liburl = needed.library_url(static.libcache) + '/' liburl = needed.library_url(static.libcache) + '/'
# nb. add custom url prefix if needed, e.g. /theo
if request.script_name:
liburl = request.script_name + liburl
if key == 'buefy': if key == 'buefy':
return 'https://unpkg.com/buefy@{}/dist/buefy.min.js'.format(version) return 'https://unpkg.com/buefy@{}/dist/buefy.min.js'.format(version)