This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-website.git


The following commit(s) were added to refs/heads/master by this push:
     new f8a3fb2078 Update for seo
f8a3fb2078 is described below

commit f8a3fb2078c04b501167ee7eb462cc816c73fe39
Author: Albumen Kevin <[email protected]>
AuthorDate: Thu Feb 23 10:41:45 2023 +0800

    Update for seo
---
 cn_config.toml             |  2 ++
 layouts/partials/head.html | 18 +++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/cn_config.toml b/cn_config.toml
index 660df7af06..9a568f8f53 100644
--- a/cn_config.toml
+++ b/cn_config.toml
@@ -83,6 +83,8 @@ guessSyntax = "true"
 [params]
 copyright = "The Apache Software Foundation. Apache and the Apache feather 
logo are trademarks of The Apache Software Foundation."
 
+cn_site = true
+
 # Repository configuration (URLs for in-page links to opening issues and 
suggesting changes)
 github_repo = "https://github.com/apache/dubbo-website";
 # An optional link to a related project repo. For example, the sibling 
repository where your product code lives.
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 233b7a62e3..626b1efbe7 100755
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -10,6 +10,22 @@
 {{ range .Translations -}}
 <link rel="alternate" hreflang="{{ .Language.Lang }}" href="{{ .Permalink }}">
 {{ end -}}
+{{ if .Params.canonicalUrl }}
+<link rel="canonical" href="{{ .Params.canonicalUrl }}">
+{{ else }}
+<link rel="canonical" href="{{ .Permalink }}">
+{{ end }}
+{{ if $.Site.Params.cn_site }}
+<script>
+    var _hmt = _hmt || [];
+    (function() {
+        var hm = document.createElement("script");
+        hm.src = "https://hm.baidu.com/hm.js?3b78f49ba47181e4d998a66b689446e9";;
+        var s = document.getElementsByTagName("script")[0];
+        s.parentNode.insertBefore(hm, s);
+    })();
+</script>
+{{ end }}
 
 <!-- Docsy head.html begins here -->
 <meta charset="utf-8">
@@ -75,4 +91,4 @@
 <!--<script defer src="https://platform.twitter.com/widgets.js"; 
charset="utf-8"></script>-->
 <script src="{{ "js/script.js" | relURL }}"></script>
 {{ with .Params.js }}{{ range (split . ",") }}<script src="{{ (trim . " ") | 
relURL }}"></script><!-- custom js added -->
-{{ end }}{{ else }}<!-- no custom js detected -->{{ end }}
\ No newline at end of file
+{{ end }}{{ else }}<!-- no custom js detected -->{{ end }}

Reply via email to