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/02/22 03:35:11 UTC
[pulsar-site] 02/05: feat: migrate about.md
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
commit 259cd477cace5dcca4bafc32c954c05a4f8a2d83
Author: LiLi <ur...@apache.org>
AuthorDate: Tue Feb 22 11:21:55 2022 +0800
feat: migrate about.md
Signed-off-by: LiLi <ur...@apache.org>
---
site2/website-next/migrate/migrate-version.js | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/site2/website-next/migrate/migrate-version.js b/site2/website-next/migrate/migrate-version.js
index d63401c..033baee 100644
--- a/site2/website-next/migrate/migrate-version.js
+++ b/site2/website-next/migrate/migrate-version.js
@@ -49,11 +49,6 @@ const migrate = (version) => {
// delDuplicate(dest, version);
//copy about.md from next version dir
- sidebar = fs.readFileSync(
- path.join(__dirname, `../../${next.baseDir}/sidebars.json`),
- "utf8"
- );
- sidebar = JSON.parse(sidebar);
let aboutDocPath = path.join(__dirname, `../../${next.docsDir}/about.md`);
let destSidebarPath = path.join(
__dirname,
@@ -70,6 +65,9 @@ const migrate = (version) => {
fs.readFileSync(aboutDocPath, "utf8")
);
}
+
+ sidebar = fs.readFileSync(destSidebarPath, "utf8");
+ sidebar = JSON.parse(sidebar);
let items = Object.values(sidebar)[0];
let aboutId = version == "next" ? "about" : `${version_full}/about`;
let _items = [
@@ -79,7 +77,7 @@ const migrate = (version) => {
},
];
for (let item of items) {
- if (item.type == "doc" && id == aboutId) {
+ if (item.type == "doc" && item.id == aboutId) {
continue;
}
_items.push(item);