getzola/even

Need help replacing remote script in index.html with a local script

UniqueActive opened this issue · 3 comments

Hello!

I very much enjoy the Even theme for Zola, but I recently found that by default, it uses jsdelivr and cloudflare to deliver some of its needed scripts. For user privacy reasons, I would like to change this, so that it instead serves the script locally.

The line especially relevant for me (since my site does not use the maths stuff) is this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/slideout/1.0.1/slideout.min.js"></script>

Since I am not familiar with web languages, could you kindly point me to the right syntax to use if I want to serve this file locally?

Thank you in advance!


P.S. I would also be very very happy if you could modify the theme to behave in this way by default, since this is an unnecessary violation of users' privacy.

Keats commented

You can do a PR to add it to the theme directly if you want

Alright, I managed to change it for my site by fetching the script, putting it in the static folder and changing that line to say

<script type="text/javascript" src="{{ get_url(path="slideout.min.js", trailing_slash=false) }}" ></script>

Now I just have to figure out how to make a PR and whether I can simply include the slideout.min.js script (didn't look into licensing stuff yet, advice appreciated).

I will also see if I can potentially replace all current JS in even with just CSS and make another PR or a fork if/when I get to that point :)