From 2e0355b631ba17676ba4e1de5950253c28f5e8e9 Mon Sep 17 00:00:00 2001 From: Brieuc Dubois Date: Fri, 19 Jan 2024 21:45:16 +0100 Subject: [PATCH] Analytics --- Dockerfile | 2 ++ layouts/partials/head.html | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 layouts/partials/head.html diff --git a/Dockerfile b/Dockerfile index 1331386..12a0338 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,8 @@ RUN apk add --update hugo WORKDIR /opt/HugoApp COPY . . +# Add analytics +COPY layouts/partials/head.html themes/hugo-blog-awesome/layouts/partials/head.html RUN hugo diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..e6e2b73 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,45 @@ + + {{- partial "meta/main.html" . }} + {{- hugo.Generator }} + + {{/* Canonical link, RSS */}} + + + {{- with .OutputFormats.Get "RSS" }} + + + {{- end }} + + {{- /* Styles */ -}} + + {{- $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "style.scss" . | toCSS (dict "targetPath" "style.css") | minify | fingerprint }} + + {{- $code_syntax_highlight_css := resources.Get "code-highlight.css" | minify | fingerprint }} + + + {{/* Favicons */}} + + + + + + + {{- partial "webmanifest.html" . -}} + {{- partial "browserconfig.html" . -}} + + + + {{/* SVG favicon for the modern web */}} + + + + {{/* Katex support (enabled on specific pages). See 'helpers/katex.html' for more info. */}} + + {{- if or .Params.math .Site.Params.math }}{{ partial "helpers/katex.html" . -}}{{- end -}} + + {{/* Google analytics script. See config.toml to enable/disable this. */}} + {{- if hugo.IsProduction | or (eq site.Params.env "production") }} + {{ template "_internal/google_analytics.html" . }} + {{- end -}} + +