Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gethugothemes/omega-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuhammad Panji <44004+sumodirjo@users.noreply.github.com>2022-08-28 13:01:37 +0300
committerGitHub <noreply@github.com>2022-08-28 13:01:37 +0300
commit88019d50ca73c5b5a2fb77256f8e457dea8f6e82 (patch)
tree9580540e3933adc454a95cfc4e2c3db97fa7b8ac
parenta694e73b0e4c10af4313d8c3aec2484f105ee4f4 (diff)
Add Twitter Cards support and fix Google Analytics (#5)
- Add Twitter Cards Support - Fix Google Analytics code to only include either GA4 or UA template
-rw-r--r--layouts/partials/head.html11
1 files changed, 8 insertions, 3 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 4e284f0..4b99270 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -36,7 +36,12 @@ AUTHOR WEBSITE: https://themefisher.com
<meta property="og:image" content="{{ . | absURL }}" />
{{ end }}
{{ template "_internal/opengraph.html" . }}
- {{ template "_internal/google_analytics.html" . }}
- {{ template "_internal/google_analytics_async.html" . }}
+ {{ template "_internal/twitter_cards.html" . }}
-</head> \ No newline at end of file
+ {{ if hasPrefix .Site.GoogleAnalytics "G-" -}}
+ {{ template "_internal/google_analytics.html" . -}}
+ {{ else -}}
+ {{ template "_internal/google_analytics_async.html" . -}}
+ {{ end -}}
+
+</head>