Remove JavaScript and external fonts from documentation site
Marco Ricci

Marco Ricci commited on 2024-07-21 23:40:08
Zeige 13 geänderte Dateien mit 30 Einfügungen und 0 Löschungen.


For better browser security and offline experience, as a base measure,
override all website templates and remove JavaScript and font inclusion.

Selective JavaScript (such as full-text search with `lunr`) might be
re-enabled later.
... ...
@@ -0,0 +1,12 @@
1
+{% extends "base.html" %}
2
+{% block analytics %}{% endblock %}
3
+{% block config %}{% endblock %}
4
+{% block libs %}{% endblock %}
5
+{% block scripts %}{% endblock %}
6
+{% block fonts %}
7
+  {% if config.theme.font != false %}
8
+    {% set text = config.theme.font.get("text", "Roboto") %}
9
+    {% set code = config.theme.font.get("code", "Roboto Mono") %}
10
+        <style>:root{--md-text-font:"{{ text }}";--md-code-font:"{{ code }}"}</style>
11
+  {% endif %}
12
+{% endblock %}
... ...
@@ -0,0 +1,15 @@
1
+{#-
2
+  This file was automatically generated - do not edit
3
+-#}
4
+<!doctype html>
5
+<html>
6
+  <head>
7
+    <meta charset="utf-8">
8
+    <meta name="viewport" content="width=device-width,initial-scale=1">
9
+    <title>{{ config.site_name }}</title>
10
+    <meta http-equiv="refresh" content="0;url={{ page.meta.location }}">
11
+  </head>
12
+  <body>
13
+    <div><a href="{{ page.meta.location | url }}">The document has moved.</a></div>
14
+  </body>
15
+</html>
... ...
@@ -43,6 +43,7 @@ theme:
43 43
     - navigation.prune
44 44
     - navigation.footer
45 45
     - toc.follow
46
+  custom_dir: docs-overrides
46 47
 
47 48
 plugins:
48 49
   - offline:
... ...
@@ -0,0 +1,2 @@
1
+
2
+Remove JavaScript and external font loading from documentation website, so that the site works even in restricted browser settings.
0 3