aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus@rgdd.se>2024-05-04 16:44:38 +0200
committerRasmus Dahlberg <rasmus@rgdd.se>2024-05-04 16:44:38 +0200
commit5e46ca558ce13446c092dd9ee6a817837dd3a309 (patch)
tree317ca78f69b42d9c260065f6320aff129bf291ac /layouts
parenta540db08b8049b367f93a423983a3cee7f8bd052 (diff)
Serve dependencies locally to get rid of trackers
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/googleanalytics.html18
-rw-r--r--layouts/partials/head.html27
-rw-r--r--layouts/partials/math.html17
3 files changed, 12 insertions, 50 deletions
diff --git a/layouts/partials/googleanalytics.html b/layouts/partials/googleanalytics.html
deleted file mode 100644
index 2d72d71..0000000
--- a/layouts/partials/googleanalytics.html
+++ /dev/null
@@ -1,18 +0,0 @@
-{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
-{{- if not $pc.Disable }}{{ with .Site.GoogleAnalytics -}}
-<script>
-{{- if not $pc.RespectDoNotTrack -}}
-var doNotTrack = false;
-{{- else -}}
-var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
-var doNotTrack = (dnt == "1" || dnt == "yes");
-{{- end -}}
-if (!doNotTrack) {
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
- gtag('config', '{{ site.Config.Services.GoogleAnalytics.ID }}');
-}
-</script>
-{{- end -}}
-{{- end -}}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 88ba7ea..0e97a2c 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -6,25 +6,22 @@
<meta name="description" content="{{ .Site.Params.description }}">
<meta name="author" content='{{ .Site.Params.author }}'>
- <link href="https://fonts.googleapis.com/css2?family=Inconsolata:wght@400;700&display=swap" rel="stylesheet">
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.2/css/bootstrap.min.css" integrity="sha512-rt/SrQ4UNIaGfDyEXZtNcyWvQeOq0QLygHluFQcSjaGB04IxWhal71tKuzP6K8eYXYB6vJV4pHkXcmFGGQ1/0w==" crossorigin="anonymous" referrerpolicy="no-referrer" />
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.9.3/css/academicons.min.css" integrity="sha512-vaoopdl+FJahyY2ddhsbDj8yDiRuyUYH/vIjF3z+cBg0sKc07NAQmUYli8volCGlW9OwlQyjVsr7Lh6qAManlw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
- {{ $style := resources.Get "sass/researcher.scss" | resources.ExecuteAsTemplate "sass/researcher.scss" . | toCSS | minify -}}
+ <link rel="stylesheet" href="/cdnjs/bootstrap.min.css">
+ <link rel="stylesheet" href="/cdnjs/all.min.css">
+ <link rel="stylesheet" href="/fontawesome/all.css">
+
+ {{ $style := resources.Get "sass/researcher.scss" | resources.ExecuteAsTemplate "sass/researcher.scss" . | toCSS | minify }}
<link rel="stylesheet" href="{{ $style.RelPermalink }}">
- {{ with .Site.Params.favicon -}}
- <link rel="icon" type="image/ico" href="{{ . | absURL }}">
- {{ end -}}
+
+ {{ with .Site.Params.favicon }}
+ <link rel="icon" type="image/ico" href="{{ . | absURL }}">
+ {{ end }}
{{ with .OutputFormats.Get "rss" -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
- {{- if not .Site.IsServer -}}
- {{- partial "googleanalytics.html" . -}}
- {{- end -}}
-
- {{ if .Params.noindex -}}
- <meta name="robots" content="noindex">
- {{ end -}}
+ {{ if not .Site.IsServer }}
+ {{ template "_internal/google_analytics.html" . }}
+ {{ end }}
</head>
diff --git a/layouts/partials/math.html b/layouts/partials/math.html
deleted file mode 100644
index c45386b..0000000
--- a/layouts/partials/math.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.css" integrity="sha512-t2ALGTyUR6g1HJiHCmSTge2yGseGofdO88Q+zOWQx/N0ikecVw0YuyOet9xZDV8+Vx0Y0n1a3f3Qx3V9CcnsKA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
-<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/katex.min.js" integrity="sha512-EKW5YvKU3hpyyOcN6jQnAxO/L8gts+YdYV6Yymtl8pk9YlYFtqJgihORuRoBXK8/cOIlappdU6Ms8KdK6yBCgA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
-<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.7/contrib/auto-render.min.js" integrity="sha512-iWiuBS5nt6r60fCz26Nd0Zqe0nbk1ZTIQbl3Kv7kYsX+yKMUFHzjaH2+AnM6vp2Xs+gNmaBAVWJjSmuPw76Efg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
-
-<!-- Script to enable inline math expressions -->
-<script>
- document.addEventListener("DOMContentLoaded", function() {
- renderMathInElement(document.body, {
- delimiters: [
- {left: "$$", right: "$$", display: true},
- {left: "\\[", right: "\\]", display: true},
- {left: "$", right: "$", display: false},
- {left: "\\(", right: "\\)", display: false}
- ]
- });
- });
-</script>