mirror of
https://github.com/imfing/hextra.git
synced 2025-06-20 01:12:03 -04:00
feat: add google analytics support (#70)
* feat: support google analytics * docs: add instruction for setting up ga
This commit is contained in:
@ -16,10 +16,21 @@
|
||||
{{ end -}}
|
||||
</title>
|
||||
<meta name="description" content="{{ partial "utils/page-description.html" . }}" />
|
||||
|
||||
{{ partial "opengraph.html" . }}
|
||||
{{ template "_internal/schema.html" . -}}
|
||||
{{ template "_internal/twitter_cards.html" . -}}
|
||||
|
||||
{{ partialCached "head-css.html" . }}
|
||||
|
||||
|
||||
<!-- Google Analytics -->
|
||||
{{- if and .Site.GoogleAnalytics (eq hugo.Environment "production") }}
|
||||
<link rel="preconnect" href="https://www.googletagmanager.com" crossorigin />
|
||||
{{ partial "google-analytics.html" . }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
<script>
|
||||
/* Initialize light/dark mode */
|
||||
if (localStorage.getItem("color-theme") === "dark" || (!("color-theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches)) {
|
||||
|
Reference in New Issue
Block a user