base.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {% extends "furo/base.html" %}
  2. {%- block regular_scripts -%}
  3. {{ super() }}
  4. <script>
  5. (() => {
  6. if (!localStorage.getItem("shownCookieAlert")) {
  7. const boxElem = document.createElement("div");
  8. boxElem.classList.add("cookie_alert");
  9. const containerElem = document.createElement("div");
  10. containerElem.classList.add("cookie_container");
  11. const textElem = document.createElement("p");
  12. textElem.innerHTML = `This page uses <a href="https://analytics.google.com/">
  13. Google Analytics</a> to collect statistics. You can disable it by blocking
  14. the JavaScript coming from www.google-analytics.com.`;
  15. containerElem.appendChild(textElem);
  16. const closeBtn = document.createElement("button");
  17. closeBtn.innerHTML = `<?xml version="1.0" ?><svg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><defs><style>.cls-1{fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px;}</style></defs><title/><g id="cross"><line class="cls-1" x1="7" x2="25" y1="7" y2="25"/><line class="cls-1" x1="7" x2="25" y1="25" y2="7"/></g></svg>`
  18. closeBtn.onclick = () => {
  19. localStorage.setItem("shownCookieAlert", "true");
  20. boxElem.style.display = "none";
  21. }
  22. containerElem.appendChild(closeBtn);
  23. boxElem.appendChild(containerElem);
  24. document.body.appendChild(boxElem);
  25. }
  26. })()
  27. </script>
  28. <!-- Google tag (gtag.js) -->
  29. <script async src="https://www.googletagmanager.com/gtag/js?id=G-JGXSLW7N06"></script>
  30. <script>
  31. window.dataLayer = window.dataLayer || [];
  32. function gtag(){dataLayer.push(arguments);}
  33. gtag('js', new Date());
  34. gtag('config', 'G-JGXSLW7N06');
  35. </script>
  36. {%- endblock regular_scripts -%}