You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by li...@apache.org on 2022/10/24 09:08:28 UTC
[pulsar-site] branch main updated: Redirect incubating docs to pulsar.staged.apache.org (#261)
This is an automated email from the ASF dual-hosted git repository.
liuyu 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 c30db65192c Redirect incubating docs to pulsar.staged.apache.org (#261)
c30db65192c is described below
commit c30db65192c9f1791bf4bd2cf1b300124643933a
Author: tison <wa...@gmail.com>
AuthorDate: Mon Oct 24 17:08:21 2022 +0800
Redirect incubating docs to pulsar.staged.apache.org (#261)
---
site2/tools/publish-website.sh | 6 ------
site2/website-next/oldversions.json | 8 --------
site2/website-next/scripts/.htaccess | 5 -----
site2/website-next/src/components/VersionsTable.js | 14 ++------------
site2/website-next/src/pages/versions.js | 2 --
site2/website-next/static/.htaccess | 10 ++++++++++
site2/website-next/versions.json | 4 +---
7 files changed, 13 insertions(+), 36 deletions(-)
diff --git a/site2/tools/publish-website.sh b/site2/tools/publish-website.sh
index e23c5b154bb..f1052103881 100755
--- a/site2/tools/publish-website.sh
+++ b/site2/tools/publish-website.sh
@@ -63,12 +63,6 @@ PULSAR_SITE_TMP=/tmp/pulsar-site
| grep -v $PULSAR_SITE_TMP/content/tools \
| grep -v $PULSAR_SITE_TMP/content/reference \
| grep -v $PULSAR_SITE_TMP/content/.htaccess \
- | grep -v $PULSAR_SITE_TMP/content/docs/v2.0.1-incubating \
- | grep -v $PULSAR_SITE_TMP/content/docs/v2.0.0-rc1-incubating \
- | grep -v $PULSAR_SITE_TMP/content/docs/v1.22.1-incubating \
- | grep -v $PULSAR_SITE_TMP/content/docs/v1.21.0-incubating \
- | grep -v $PULSAR_SITE_TMP/content/docs/v1.20.0-incubating \
- | grep -v $PULSAR_SITE_TMP/content/docs/v1.19.0-incubating\
| xargs rm -rf
fi
cp -r $GENERATED_SITE_DIR/content/* $PULSAR_SITE_TMP/content
diff --git a/site2/website-next/oldversions.json b/site2/website-next/oldversions.json
deleted file mode 100644
index a83f27fb697..00000000000
--- a/site2/website-next/oldversions.json
+++ /dev/null
@@ -1,8 +0,0 @@
-[
- "2.0.1-incubating",
- "2.0.0-rc1-incubating",
- "1.22.0-incubating",
- "1.21.0-incubating",
- "1.20.0-incubating",
- "1.19.0-incubating"
-]
diff --git a/site2/website-next/scripts/.htaccess b/site2/website-next/scripts/.htaccess
deleted file mode 100755
index 7433f6f0ef9..00000000000
--- a/site2/website-next/scripts/.htaccess
+++ /dev/null
@@ -1,5 +0,0 @@
-RewriteEngine On
-
-RewriteRule "^en/(.+)$" "/$1" [R=301,DPI,L]
-RewriteRule "^docs/en/(.+)$" "/docs/$1" [R=301,DPI,L]
-RewriteRule "^docs/(zh-CN|zh-TW|ja|ko|fr)/(.+)$" "/$1/docs/$2" [R=301,DPI,L]
\ No newline at end of file
diff --git a/site2/website-next/src/components/VersionsTable.js b/site2/website-next/src/components/VersionsTable.js
index b088231f551..a7e98d41599 100644
--- a/site2/website-next/src/components/VersionsTable.js
+++ b/site2/website-next/src/components/VersionsTable.js
@@ -4,18 +4,12 @@ import TableBody from "@mui/material/TableBody";
import TableCell from "@mui/material/TableCell";
import TableRow from "@mui/material/TableRow";
import Link from "@mui/material/Link";
-import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
-import Translate, { translate } from "@docusaurus/Translate";
+import Translate from "@docusaurus/Translate";
import { docUrl, getCache } from "../utils/index";
const versions = require("../../versions.json");
-const oldversions = require("../../oldversions.json");
-const legacyVersions = require(`../../legacy-versions.json`);
export default function VersionsTable(props) {
- const { siteConfig } = useDocusaurusContext();
const latestStableVersion = versions[0];
-
- const repoUrl = `https://github.com/${siteConfig.organizationName}/${siteConfig.projectName}`;
return (
<Table size="small" sx={{ maxWidth: 500 }}>
<TableBody>
@@ -38,11 +32,7 @@ export default function VersionsTable(props) {
href={docUrl(
"",
"",
- row.name == latestStableVersion
- ? ""
- : oldversions.includes(row.name.replace("v", ""))
- ? row.name + "/getting-started/LocalCluster"
- : row.name
+ row.name == latestStableVersion ? "" : row.name
)}
underline="none"
onClick={() => {
diff --git a/site2/website-next/src/pages/versions.js b/site2/website-next/src/pages/versions.js
index 2d14dc3378c..af67cb5110c 100644
--- a/site2/website-next/src/pages/versions.js
+++ b/site2/website-next/src/pages/versions.js
@@ -4,7 +4,6 @@ import VersionsTable from "../components/VersionsTable";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Translate, { translate } from "@docusaurus/Translate";
const versions = require("../../versions.json");
-const oldversions = require("../../oldversions.json");
export default function DenseTable() {
const { siteConfig } = useDocusaurusContext();
@@ -50,7 +49,6 @@ export default function DenseTable() {
<VersionsTable
data={versions
.filter((item) => item != latestStableVersion)
- .concat(oldversions.map((item) => "v" + item))
.map((item) => ({
name: item,
}))}
diff --git a/site2/website-next/static/.htaccess b/site2/website-next/static/.htaccess
new file mode 100755
index 00000000000..d00a5b4159f
--- /dev/null
+++ b/site2/website-next/static/.htaccess
@@ -0,0 +1,10 @@
+RewriteEngine On
+
+RewriteRule "^en/(.+)$" "/$1" [R=301,DPI,L]
+RewriteRule "^docs/en/(.+)$" "/docs/$1" [R=301,DPI,L]
+RewriteRule "^docs/(zh-CN|zh-TW|ja|ko|fr)/(.+)$" "/$1/docs/$2" [R=301,DPI,L]
+RewriteRule "^(zh-CN|zh-TW|ja|ko|fr)/docs/(.+)$" "/docs/$2" [R=301,DPI,L]
+RewriteRule "^docs$" "/docs/" [R=301,DPI,L]
+RewriteRule "^docs/(.+)-incubating/(.+)$" "https://pulsar.staged.apache.org/docs/$1-incubating/$2" [R=301,DPI,L]
+
+RewriteRule "^docs/(.*)develop-binary-protocol(.*)$" "/docs/$1developing-binary-protocol$2" [R=301,DPI,L]
diff --git a/site2/website-next/versions.json b/site2/website-next/versions.json
index b2a3ee57c77..270b0693288 100644
--- a/site2/website-next/versions.json
+++ b/site2/website-next/versions.json
@@ -23,7 +23,5 @@
"2.3.1",
"2.3.0",
"2.2.1",
- "2.2.0",
- "2.1.1-incubating",
- "2.1.0-incubating"
+ "2.2.0"
]