Analytics
Build and publish / docker (push) Successful in 1m12s Details

This commit is contained in:
Brieuc Dubois 2024-01-19 21:45:16 +01:00
parent a8e541672a
commit 73f10385af
2 changed files with 47 additions and 0 deletions

View File

@ -5,6 +5,8 @@ RUN apk add --update hugo
WORKDIR /opt/HugoApp WORKDIR /opt/HugoApp
COPY . . COPY . .
# Add analytics
COPY layouts/partials/head.html themes/hugo-blog-awesome/layouts/partials/head.html
RUN hugo RUN hugo

View File

@ -0,0 +1,45 @@
<head>
{{- partial "meta/main.html" . }}
{{- hugo.Generator }}
{{/* Canonical link, RSS */}}
<link rel="canonical" href="{{ .Permalink }}">
{{- with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}">
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}">
{{- end }}
{{- /* Styles */ -}}
{{- $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "style.scss" . | toCSS (dict "targetPath" "style.css") | minify | fingerprint }}
<link href="{{ $style.RelPermalink }}" rel="stylesheet">
{{- $code_syntax_highlight_css := resources.Get "code-highlight.css" | minify | fingerprint }}
<link href="{{ $code_syntax_highlight_css.RelPermalink }}" rel="stylesheet">
{{/* Favicons */}}
<link rel="apple-touch-icon" sizes="180x180" href="{{ (resources.Get "icons/apple-touch-icon.png").RelPermalink }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ (resources.Get "icons/favicon-32x32.png").RelPermalink }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ (resources.Get "icons/favicon-16x16.png").RelPermalink }}">
<link rel="mask-icon" href="{{ (resources.Get "icons/safari-pinned-tab.svg").RelPermalink }}">
<link rel="shortcut icon" href="{{ (resources.Get "icons/favicon.ico" | resources.Copy "favicon.ico").RelPermalink }}">
{{- partial "webmanifest.html" . -}}
{{- partial "browserconfig.html" . -}}
<meta name="theme-color" content="{{ .Site.Params.webmanifest.theme_color | default "#434648" }}">
{{/* SVG favicon for the modern web */}}
<link rel="icon" type="image/svg+xml" href="{{ (resources.Get "icons/favicon.svg").RelPermalink }}">
<script data-goatcounter="https://counter.bhasher.com/count" async src="https://counter.bhasher.com/count.js"></script>
{{/* 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 -}}
</head>