You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by ur...@apache.org on 2022/06/10 05:35:23 UTC

[pulsar-site] 01/01: fix: auto replace some link that cause 404 before building

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

urfree pushed a commit to branch fix/404-link
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit 255dcffc884d24e0dab0faaf20a04faa18c34005
Author: Li Li <ur...@apache.org>
AuthorDate: Fri Jun 10 13:35:11 2022 +0800

    fix: auto replace some link that cause 404 before building
    
    Signed-off-by: Li Li <ur...@apache.org>
---
 site2/website-next/scripts/replace.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/site2/website-next/scripts/replace.js b/site2/website-next/scripts/replace.js
index e3c8c1e590d..3d070cd0329 100644
--- a/site2/website-next/scripts/replace.js
+++ b/site2/website-next/scripts/replace.js
@@ -156,6 +156,8 @@ const from = [
   /\/api\/admin/g,
 
   /@pulsar:version_number@/g,
+
+  /\[([^\]]*)\]\((\/tools\/pulsar[^\)]*)\)/g,
 ];
 
 const options = {
@@ -186,7 +188,10 @@ const options = {
     clientVersionUrl(`${latestVersion}`, "pulsar-functions"),
     clientVersionUrl(`${latestVersion}`, "client"),
     clientVersionUrl(`${latestVersion}`, "admin"),
+
     `${latestVersion}`,
+
+    '<a href="$2" target="_blank">$1</a>',
   ],
   dry: false,
 };
@@ -232,8 +237,9 @@ for (v of versions) {
       clientVersionUrl(`${v}`, "client"),
       clientVersionUrl(`${v}`, "admin"),
       `${v}`,
+      '<a href="$2" target="_blank">$1</a>',
     ],
     dry: false,
   };
-  doReplace(opts);
+  // doReplace(opts);
 }