Attempted Debugging
Searched GitHub Issues
Describe the Scenario
My theme needs a small amount of Javascript. How can I load that Javascript file from my themes folder (e.g. BookStack/themes/my_theme/js/script.js)?
What I tried and didn't work:
- Put this into the Custom Head Setting on the customization page -> My customization needing that script is on the customization page itself and the Custom Head Setting is not loaded there.
- Overwrite
common/custom-head.blade.php or layouts/base.blade.php or layouts/parts/base-body-start.blade.php or layouts/parts/base-body-start.blade.php and add the <script> block in there -> My browser blocks inline scripts; I get the Browser-Log Message "Content-Security-Policy: The page's settings blocked the loading of a resource on inline ('script-src')"
- This was inspired by this issue wich is pretty similar but the final solution wasn't presented there and I failed to figure out the details.
What worked but is no clean solution:
- I put the script.js file into the folder
Bookstack/public/dist. From there it is loaded, but this would mean that I would have to create my own Docker Image just to add that one file
Exact BookStack Version
v23.08.3
Log Content
No response
Hosting Environment
Docker Compose on local machine
Attempted Debugging
Searched GitHub Issues
Describe the Scenario
My theme needs a small amount of Javascript. How can I load that Javascript file from my themes folder (e.g. BookStack/themes/my_theme/js/script.js)?
What I tried and didn't work:
common/custom-head.blade.phporlayouts/base.blade.phporlayouts/parts/base-body-start.blade.phporlayouts/parts/base-body-start.blade.phpand add the <script> block in there -> My browser blocks inline scripts; I get the Browser-Log Message "Content-Security-Policy: The page's settings blocked the loading of a resource on inline ('script-src')"What worked but is no clean solution:
Bookstack/public/dist. From there it is loaded, but this would mean that I would have to create my own Docker Image just to add that one fileExact BookStack Version
v23.08.3
Log Content
No response
Hosting Environment
Docker Compose on local machine