feat: add support for baidu_tongji and baidu_site_verification

The new options can be added under `marketing` in `params.toml`
This commit is contained in:
George Cushen committed 2021-02-22 20:51:20 +00:00
1 parent a9a74e160d
commit 69de00c0cd
2 files changed
+17

No files matched your search

@@ -0,0 +1,13 @@
{{ $baidu_tongji := site.Params.marketing.baidu_tongji | default "" }}
{{ if hugo.IsProduction | and $baidu_tongji }}
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?{{ $baidu_tongji }}";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
{{ end }}
+4
View File
@@ -15,6 +15,9 @@
{{ with site.Params.marketing.google_site_verification }}
<meta name="google-site-verification" content="{{ . }}" />
{{- end -}}
{{ with site.Params.marketing.baidu_site_verification }}
<meta name="baidu-site-verification" content="{{ . }}" />
{{- end -}}
{{ $scr := .Scratch }}
@@ -182,6 +185,7 @@
{{ partial "marketing/google_analytics" . }}
{{ partial "marketing/google_tag_manager" . }}
{{ partial "marketing/microsoft_clarity" . }}
{{ partial "marketing/baidu_tongji" . }}
{{/* Netlify Identity integration. */}}
{{ $use_cms := templates.Exists "wowchemycms/single.wowchemycms_config.yml" | default (site.Params.cms.netlify_cms | default false) }}