summaryrefslogtreecommitdiffstats
path: root/layouts/partials
diff options
context:
space:
mode:
authoramzrk22020-05-30 12:36:29 +0800
committeramzrk22020-05-30 12:36:29 +0800
commitcf395763b26103b1b147bc40d8a3126e92996b97 (patch)
treef3825b4f8bac4683a35887eb36086c2e8382c309 /layouts/partials
parent594655b050145b7c3beab06166678940e613a79a (diff)
downloadhugo-theme-fuji-cf395763b26103b1b147bc40d8a3126e92996b97.tar.gz
hugo-theme-fuji-cf395763b26103b1b147bc40d8a3126e92996b97.tar.bz2
hugo-theme-fuji-cf395763b26103b1b147bc40d8a3126e92996b97.zip
Update cfga
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/analytic-cfga.html7
-rw-r--r--layouts/partials/analytic-gtag.html13
-rw-r--r--layouts/partials/head.html15
3 files changed, 22 insertions, 13 deletions
diff --git a/layouts/partials/analytic-cfga.html b/layouts/partials/analytic-cfga.html
new file mode 100644
index 0000000..ee7567e
--- /dev/null
+++ b/layouts/partials/analytic-cfga.html
@@ -0,0 +1,7 @@
+{{ if .Site.Params.googleAnalyticsTid }}
+<script>
+ window.ga_tid = '{{ .Site.Params.googleAnalyticsTid }}';
+ window.ga_api = '{{ .Site.Params.googleAnalyticsRoute }}';
+</script>
+<script src="https://cdn.jsdelivr.net/npm/cfga@1.0.1/cfga.min.js" async></script>
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/analytic-gtag.html b/layouts/partials/analytic-gtag.html
new file mode 100644
index 0000000..f43e48a
--- /dev/null
+++ b/layouts/partials/analytic-gtag.html
@@ -0,0 +1,13 @@
+{{ with .Site.GoogleAnalytics }}
+<!-- GA -->
+<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
+<script>
+ window.dataLayer = window.dataLayer || [];
+
+ function gtag() {
+ dataLayer.push(arguments);
+ }
+ gtag('js', new Date());
+ gtag('config', '{{ . }}');
+</script>
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 85b77cc..f52a7ce 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -56,16 +56,5 @@
<script src="{{ "/assets/js/APlayer.min.js" | relURL }}"></script>
{{ end }}
-{{ with .Site.GoogleAnalytics }}
-<!-- GA -->
-<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
-<script>
- window.dataLayer = window.dataLayer || [];
-
- function gtag() {
- dataLayer.push(arguments);
- }
- gtag('js', new Date());
- gtag('config', '{{ . }}');
-</script>
-{{ end }} \ No newline at end of file
+{{ partial "analytic-gtag.html" . }}
+{{ partial "analytic-cfga.html" . }} \ No newline at end of file