Skip to content

Commit

Permalink
Ensure user assets are relative (#2162)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Apr 9, 2021
1 parent 8dfcb6e commit 364f97d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions panel/template/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,19 @@ def _template_resources(self):
js_path += '.mjs'
if os.path.isfile(BUNDLE_DIR / js_path.replace('/', os.path.sep)):
js_modules[jsname] = dist_path + f'bundled/js/{js_path}'
js_files.update(self.config.js_files)
js_modules.update(self.config.js_modules)
extra_css = list(self.config.css_files)
for name, js in self.config.js_files.items():
if not '//' in js and state.rel_path:
js = f'{state.rel_path}/{js}'
js_files[name] = js
for name, js in self.config.js_modules.items():
if not '//' in js and state.rel_path:
js = f'{state.rel_path}/{js}'
js_modules[name] = js
extra_css = []
for css in list(self.config.css_files):
if not '//' in css and state.rel_path:
css = f'{state.rel_path}/{css}'
extra_css.append(css)
raw_css = list(self.config.raw_css)

# CSS files
Expand Down

0 comments on commit 364f97d

Please sign in to comment.