getzola / even

A clean blog theme for Zola
MIT License
71 stars 47 forks source link

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

Open UniqueActive opened 4 years ago

UniqueActive commented 4 years ago

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 4 years ago

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

UniqueActive commented 4 years ago

I would/will once I figure out the necessary syntax. Spent the past day learning HTML and CSS for this, but I like the theme very much already, so I might work on it/extend it once I figure out the templating language aswell :)

UniqueActive commented 4 years ago

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 :)