From 5e6a4af28b81cd1ea6f517816e188d2158e30df9 Mon Sep 17 00:00:00 2001 From: Jack Tracey <41163455+jtracey93@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:12:33 +0000 Subject: [PATCH] feat: add Microsoft Clarity integration and update site layout (#23) --- docs/data/consent.yaml | 5 + docs/layouts/_default/baseof.html | 68 ++++++++++ docs/layouts/partials/consent.html | 166 +++++++++++++++++++++++++ docs/layouts/partials/site-footer.html | 55 ++++++++ docs/static/js/clarity.js | 5 + 5 files changed, 299 insertions(+) create mode 100644 docs/data/consent.yaml create mode 100644 docs/layouts/_default/baseof.html create mode 100644 docs/layouts/partials/consent.html create mode 100644 docs/layouts/partials/site-footer.html create mode 100644 docs/static/js/clarity.js diff --git a/docs/data/consent.yaml b/docs/data/consent.yaml new file mode 100644 index 0000000..2f6ea06 --- /dev/null +++ b/docs/data/consent.yaml @@ -0,0 +1,5 @@ +items: + - title: Microsoft Clarity + description: This code gives us insight into the number of people that visit our website, where they are from and what they are clicking on. For more information see https://learn.microsoft.com/clarity/setup-and-installation/cookie-list + is_functional: false + script_file: clarity.js \ No newline at end of file diff --git a/docs/layouts/_default/baseof.html b/docs/layouts/_default/baseof.html new file mode 100644 index 0000000..25d95ff --- /dev/null +++ b/docs/layouts/_default/baseof.html @@ -0,0 +1,68 @@ + + + + {{ partial "head/meta" . }} + + {{- if eq .Kind "home" -}} + {{ .Site.Title }} + {{- else -}} + {{ printf "%s | %s" (partial "utils/title" .) .Site.Title }} + {{- end -}} + + + {{ partial "head/favicons" . }} + {{ partial "head/rel-me" . }} + {{ partial "head/microformats" . }} + {{ partial "head/others" . }} + {{ partial "head/custom" . }} + + + + {{ partial "svg-icon-symbols" . }} + + +
+ + + {{ $navEnabled := default true .Page.Params.geekdocNav }} + {{ partial "site-header" (dict "Root" . "MenuEnabled" $navEnabled) }} + + +
+ {{ if $navEnabled }} + + {{ end }} + + +
+ {{ template "main" . }} + + + {{ $showPrevNext := (default true .Site.Params.geekdocNextPrev) }} + {{ if $showPrevNext }} + + {{ end }} +
+
+ + {{ partial "site-footer" . }} +
+ + {{ partial "foot" . }} + {{ partial "consent.html" . }} + + diff --git a/docs/layouts/partials/consent.html b/docs/layouts/partials/consent.html new file mode 100644 index 0000000..9924ef1 --- /dev/null +++ b/docs/layouts/partials/consent.html @@ -0,0 +1,166 @@ + + + + + +{{ range $index, $item := .Site.Data.consent.items }} + {{ if $item.is_functional }} + + {{ end }} +{{ end }} \ No newline at end of file diff --git a/docs/layouts/partials/site-footer.html b/docs/layouts/partials/site-footer.html new file mode 100644 index 0000000..a1ada86 --- /dev/null +++ b/docs/layouts/partials/site-footer.html @@ -0,0 +1,55 @@ + diff --git a/docs/static/js/clarity.js b/docs/static/js/clarity.js new file mode 100644 index 0000000..06585c8 --- /dev/null +++ b/docs/static/js/clarity.js @@ -0,0 +1,5 @@ +(function(c,l,a,r,i,t,y){ + c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; + t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; + y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); +})(window, document, "clarity", "script", "pr5921moq3"); \ No newline at end of file