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

github.com/themefisher/kross-hugo-portfolio-template.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChi Zhang <zhangch@jnist.cn>2021-09-09 15:15:25 +0300
committerChi Zhang <zhangch@jnist.cn>2021-09-09 15:15:25 +0300
commit1808172f31805179406b493abdb31d36b6c1fc8b (patch)
tree961a235cf13ce501c43ab0d390641cb58d63ad1d
parentb743bad139383ab0bb2d788f54b90c30d9f17454 (diff)
:mag: baidu analytics
-rw-r--r--exampleSite/config.toml2
-rw-r--r--layouts/partials/head.html13
2 files changed, 15 insertions, 0 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 652efd1..28e7d3a 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -66,6 +66,8 @@ description = "This is meta description"
google_analytics_id = "" # Your ID
# baidu site verification
baidu_site_verification = "" Your verification code
+# baidu analytics
+baidu_analytics_id = "" Your ID
# copyright
copyright = "Copyright &copy; 2021 a Theme by [Gethugothemes](https://gethugothemes.com)"
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 3c5b0b5..b9ed3f7 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -44,4 +44,17 @@
</script>
{{ end }}
+ {{ with site.Params.baidu_analytics_id }}
+ {{ "<!-- Baidu analytics -->" | safeHTML }}
+ <script>
+ var _hmt = _hmt || [];
+ (function() {
+ var hm = document.createElement("script");
+ hm.src = "https://hm.baidu.com/hm.js?{{ . }}";
+ var s = document.getElementsByTagName("script")[0];
+ s.parentNode.insertBefore(hm, s);
+ })();
+ </script>
+ {{ end }}
+
</head> \ No newline at end of file