You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by li...@apache.org on 2021/09/09 10:01:45 UTC

[apisix-website] branch master updated: fix: wrong tags link (#565)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new e92c329  fix: wrong tags link (#565)
e92c329 is described below

commit e92c3290f761cacad93bf99b9b35e2b44387d6dc
Author: Baoyuan <ba...@gmail.com>
AuthorDate: Thu Sep 9 05:01:39 2021 -0500

    fix: wrong tags link (#565)
---
 website/src/theme/BlogSidebar/index.js | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/website/src/theme/BlogSidebar/index.js b/website/src/theme/BlogSidebar/index.js
index e873afe..c3ee76a 100644
--- a/website/src/theme/BlogSidebar/index.js
+++ b/website/src/theme/BlogSidebar/index.js
@@ -20,7 +20,7 @@ export default function BlogSidebar({count}) {
       setSelected('All');
     } else if (path.length === 4) {
       if (path[3].indexOf('-') !== -1) {
-        setSelected(path[3].replace('-', ' '));
+        setSelected(path[3].replace(/-/g, ' '));
       } else {
         setSelected(path[3]);
       }
@@ -34,14 +34,13 @@ export default function BlogSidebar({count}) {
   }
 
   const handleTagClick = (tag) => {
-    setSelected(tag);
     if (tag === "All") {
-      history.push('/blog');
+      history.push(`/${path[1] || '/'}`);
     } else {
       if (tag.indexOf(' ') !== -1) {
-        tag = tag.replace(' ', '-');
+        tag = tag.replace(/ /g, '-');
       }
-      history.push(`/blog/tags/${tag}`);
+      history.push(`/${path[1]}/tags/${tag}`);
     }
   };