This is an automated email from the ASF dual-hosted git repository. juzhiyuan pushed a commit to branch chore-minor-issues in repository https://gitbox.apache.org/repos/asf/apisix-website.git
commit 7bc3c1779c121ddf55a2c2464e8c838361ac5e05 Author: juzhiyuan <[email protected]> AuthorDate: Thu Dec 2 22:06:19 2021 +0800 chore: remove release & update navbar --- scripts/sync-docs.js | 117 ------------------------------------------- website/config/navbar.js | 53 ++++++-------------- website/docusaurus.config.js | 8 --- 3 files changed, 14 insertions(+), 164 deletions(-) diff --git a/scripts/sync-docs.js b/scripts/sync-docs.js index 45458e9..f971bef 100644 --- a/scripts/sync-docs.js +++ b/scripts/sync-docs.js @@ -13,7 +13,6 @@ const common = require("./common.js"); const git = simpleGit(); const {projects, languages, projectPaths} = common; const tempPath = "./tmp"; -const releaseTempPath = `${tempPath}/releases`; const websitePath = "../website"; const projectReleases = {}; @@ -148,122 +147,6 @@ const tasks = new listr([ } }, { - title: "Fetch project release logs", - task: () => { - const fetchReleaseLogTasks = projects.map((project) => { - if (!project.hasChangelog) { - return { - title: `Fetch ${project.name} release logs`, - skip: () => { - return `${project.name} has no changelog`; - }, - task: () => { - } - } - } - - const releaseURL = `https://api.github.com/repos/apache/${project.name}/releases`; - const changelogURL = `https://raw.githubusercontent.com/apache/${project.name}/${project.branch}/CHANGELOG.md`; - - return { - title: `Fetch ${project.name} release logs`, - task: () => { - let releaseResult; - let changelogResult = ''; - let changelogList = []; - const steps = [ - { - title: `Fetch ${project.name}'s release list`, - task: async () => { - try { - releaseResult = (await axios.get(releaseURL)).data; - } catch (e) { - log(`Fetch ${project.name} release list failed: ` + e) - } - } - }, - { - title: `Fetch ${project.name}'s CHANGELOG.md`, - task: async () => { - try { - changelogResult = (await axios.get(changelogURL)).data; - } catch (e) { - log(`Fetch ${project.name} changelog failed: ` + e) - } - } - }, - { - title: "Extract changelog in CHANGELOG.md", - task: () => { - releaseResult.forEach(item => { - if ("changelogExtractor" in project) { - let changelog = project.changelogExtractor(changelogResult, item); - if (changelog) changelogList.push(changelog); - } - }); - } - }, - { - title: "Remove unsupport tags", - task: () => { - const unsupportTags = { - "<details>": "", - "</details>": "", - "<summary>": "", - "</summary>": "", - "<p>": "", - "</p>": "", - }; - - changelogList = changelogList.map(item => { - Object.keys(unsupportTags).forEach(tag => { - if (item.changelog.includes(tag)) { - item.changelog = item.changelog.replace(new RegExp(tag, "g"), unsupportTags[tag]); - } - }); - - return item; - }); - } - }, - { - title: "Generate Release Logs", - task: () => { - if (!isFileExisted(releaseTempPath)) { - removeFolder(releaseTempPath); - fs.mkdirSync(releaseTempPath); - } - changelogList.forEach(item => { - const releaseTime = new Date(item.releaseTime); - const logName = `${releaseTime.getFullYear()}-${releaseTime.getMonth() + 1}-${releaseTime.getDate()}-release-apache-${project.name}-${item.version}.md`; - const humanProjectName = project.name.split("-").map(name => { - if (name === 'apisix') return name.toUpperCase(); - return name.charAt(0).toUpperCase() + name.slice(1); - }).join(" "); - const header = `--- -title: Release Apache ${humanProjectName} ${item.version} -tags: - - ${humanProjectName} ----\n\n`; - fs.writeFileSync(`${releaseTempPath}/${logName}`, header + item.changelog); - }); - } - }, - { - title: "Copy Release Logs to website", - task: () => { - copyFolder(releaseTempPath, `${websitePath}/releases`); - } - }, - ]; - return new listr(steps); - } - } - }); - return new listr(fetchReleaseLogTasks); - } - }, - { title: "Clean temporary files", task: () => { removeFolder(tempPath); diff --git a/website/config/navbar.js b/website/config/navbar.js index 40d4d0c..8d7c27c 100644 --- a/website/config/navbar.js +++ b/website/config/navbar.js @@ -43,28 +43,6 @@ module.exports = [ ], }, { - label: "FAQ", - position: "right", - items: [ - { - label: "Apache APISIX®", - to: "/docs/apisix/FAQ/", - }, - { - label: "Apache APISIX® Dashboard", - to: "/docs/dashboard/FAQ/", - }, - { - label: "Apache APISIX® Ingress Controller", - to: "/docs/ingress-controller/FAQ/", - }, - { - label: "Apache APISIX® Helm Chart", - to: "/docs/helm-chart/FAQ/", - }, - ] - }, - { to: "/blog", label: "Blog", position: "right", @@ -75,25 +53,32 @@ module.exports = [ position: "right", }, { - to: "/team", - label: "Team", - position: "right", + to: "https://github.com/apache/apisix/discussions", + label: "Discussions" }, { label: "Resources", position: "right", items: [ { - to: "/docs/general/community", - label: "Community" + to: "/showcase", + label: "Showcase" }, { to: "/plugins", label: "Plugin Hub", }, { - to: "/releases", - label: "Releases", + to: "/docs/general/community", + label: "Community" + }, + { + to: "/contribute", + label: "Contribute" + }, + { + to: "/team", + label: "Team" }, { to: "/help", @@ -102,16 +87,6 @@ module.exports = [ ] }, { - to: "/showcase", - label: "Showcase", - position: "right", - }, - { - to: "/contribute", - label: "Contribute", - position: "right", - }, - { type: "localeDropdown", position: "right", }, diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index dfbab64..c00d8d8 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -108,14 +108,6 @@ module.exports = { [ "@docusaurus/plugin-content-blog", { - id: "releases", - routeBasePath: "releases", - path: "releases", - }, - ], - [ - "@docusaurus/plugin-content-blog", - { id: "articles", routeBasePath: "articles", path: "articles",
