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/29 06:21:12 UTC
[pulsar-site] branch main updated: fix the doc link mismatch problem.
This is an automated email from the ASF dual-hosted git repository.
urfree pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git
The following commit(s) were added to refs/heads/main by this push:
new 0d253e1875c fix the doc link mismatch problem.
new 51621fd691d Merge pull request #127 from horizonzy/fix-the-link-mismtach-problem
0d253e1875c is described below
commit 0d253e1875ca165366599cd3c1ec0c259bba312a
Author: horizonzy <ho...@apache.org>
AuthorDate: Wed Jun 29 10:57:30 2022 +0800
fix the doc link mismatch problem.
---
site2/website-next/docusaurus.config.js | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/site2/website-next/docusaurus.config.js b/site2/website-next/docusaurus.config.js
index 376a53299cf..7d89b133135 100644
--- a/site2/website-next/docusaurus.config.js
+++ b/site2/website-next/docusaurus.config.js
@@ -106,14 +106,15 @@ const injectLinkParseForEndpoint = ([, info]) => {
restBaseUrl = sinkApiUrl;
}
let restUrl = "";
- if (suffix.indexOf("?version") >= 0) {
- restUrl = suffix + "&apiVersion=" + restApiVersion;
+ if (suffix.indexOf("?version=") >= 0) {
+ const suffixAndVersion = suffix.split("?version=")
+ restUrl = "version=" + suffixAndVersion[1] + "&apiversion=" + restApiVersion + "#" + suffixAndVersion[0];
} else {
- restUrl = suffix + "version=master&apiVersion=" + restApiVersion;
+ restUrl = "version=master&apiversion=" + restApiVersion + "#" + suffix;
}
return {
text: method + " " + path,
- link: restBaseUrl + "#" + restUrl,
+ link: restBaseUrl + "?" + restUrl,
};
};