diff options
author | amzrk2 | 2020-05-30 12:36:29 +0800 |
---|---|---|
committer | amzrk2 | 2020-05-30 12:36:29 +0800 |
commit | cf395763b26103b1b147bc40d8a3126e92996b97 (patch) | |
tree | f3825b4f8bac4683a35887eb36086c2e8382c309 /layouts | |
parent | 594655b050145b7c3beab06166678940e613a79a (diff) | |
download | hugo-theme-fuji-cf395763b26103b1b147bc40d8a3126e92996b97.tar.gz hugo-theme-fuji-cf395763b26103b1b147bc40d8a3126e92996b97.tar.bz2 hugo-theme-fuji-cf395763b26103b1b147bc40d8a3126e92996b97.zip |
Update cfga
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/analytic-cfga.html | 7 | ||||
-rw-r--r-- | layouts/partials/analytic-gtag.html | 13 | ||||
-rw-r--r-- | layouts/partials/head.html | 15 |
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 |