Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional-js files must be in root directory? #1111

Closed
JoshOrndorff opened this issue Dec 6, 2019 · 4 comments
Closed

additional-js files must be in root directory? #1111

JoshOrndorff opened this issue Dec 6, 2019 · 4 comments

Comments

@JoshOrndorff
Copy link

I'm using additional-js to include some google analytics and consent items. I would like those scripts to live in a dedicated directory, but they will not load from anywhere other than the root.

additional-js = ["static/js/load.js", "static/js/config.js", "static/js/klaro.min.js"]

We've had to make this patch to work around the issue JoshOrndorff/recipes#54

@ehuss
Copy link
Contributor

ehuss commented Dec 13, 2019

It seems to work for me. Can you say more about what was wrong?

Also, it looks like your project has already moved them back to a dedicated folder via JoshOrndorff/recipes#87?

@JoshOrndorff
Copy link
Author

Indeed they were moved back to the subdirectory, and thus the scripts no longer load.

When I load the live site (substrate.dev/recipes), the "can we use cookies" dialog does not show and my console says Loading failed for the <script> with source "https://substrate.dev/recipes/klaro.min.js".

It is trying to load that script from the root even though book.toml points to a different location

@ehuss
Copy link
Contributor

ehuss commented Dec 14, 2019

Oh! It looks like you're using an old version of mdbook. I think this was fixed a while ago (#796). Can you try the latest version (0.3.5)?

@JoshOrndorff
Copy link
Author

Thank you for your time finding this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants