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

urfree pushed a commit to branch feature/releases-notes-page
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit 7f78ba98599e95236b01bf0629f17c4cf50057a9
Author: LiLi <[email protected]>
AuthorDate: Wed Mar 9 16:20:58 2022 +0800

    feat: new releases notes page
    
    Signed-off-by: LiLi <[email protected]>
---
 site2/website-next/docusaurus.config.js            | 29 +++++++++++++
 .../release-notes.md => releases-notes/all.md}     |  5 ++-
 site2/website-next/releases-notes/timeline.md      |  7 ++++
 site2/website-next/sidebarsReleasesNotes.js        | 47 ++++++++++++++++++++++
 site2/website-next/src/components/VersionsTable.js |  2 +-
 5 files changed, 88 insertions(+), 2 deletions(-)

diff --git a/site2/website-next/docusaurus.config.js 
b/site2/website-next/docusaurus.config.js
index 84fcc9e..ea9a369 100644
--- a/site2/website-next/docusaurus.config.js
+++ b/site2/website-next/docusaurus.config.js
@@ -358,6 +358,7 @@ module.exports = {
       "@docusaurus/preset-classic",
       {
         docs: {
+          path: "docs",
           sidebarPath: require.resolve("./sidebars.js"),
           editUrl: `${githubUrl}/edit/master/site2/website-next`,
           remarkPlugins: [
@@ -389,6 +390,34 @@ module.exports = {
       },
     ],
     "./postcss-tailwind-loader",
+    // [
+    //   "@docusaurus/plugin-content-docs",
+    //   {
+    //     id: "releases-notes",
+    //     path: "all",
+    //     routeBasePath: "releases-notes",
+    //     sidebarPath: require.resolve("./sidebarsReleasesNotes.js"),
+    //   },
+    // ],
+    [
+      "content-docs",
+      /** @type {import('@docusaurus/plugin-content-docs').Options} */
+      ({
+        id: "releases-notes",
+        path: "releases-notes",
+        routeBasePath: "releases-notes",
+        // editUrl: ({ locale, versionDocsDirPath, docPath }) => {
+        //   if (locale !== "en") {
+        //     return `https://crowdin.com/project/docusaurus-v2/${locale}`;
+        //   }
+        //   return 
`https://github.com/facebook/docusaurus/edit/main/website/${versionDocsDirPath}/${docPath}`;
+        // },
+        // editCurrentVersion: true,
+        sidebarPath: require.resolve("./sidebarsReleasesNotes.js"),
+        // showLastUpdateAuthor: true,
+        // showLastUpdateTime: true,
+      }),
+    ],
   ],
   scripts: [
     {
diff --git a/site2/website-next/src/pages/release-notes.md 
b/site2/website-next/releases-notes/all.md
similarity index 99%
rename from site2/website-next/src/pages/release-notes.md
rename to site2/website-next/releases-notes/all.md
index d29dcb0..9e0136a 100644
--- a/site2/website-next/src/pages/release-notes.md
+++ b/site2/website-next/releases-notes/all.md
@@ -1,5 +1,8 @@
 ---
-title: Release Notes 
+id: all
+title: All Releases
+sidebar_label: All Releases
+slug: /
 ---
 
 ## Apache Pulsar Release Notes
diff --git a/site2/website-next/releases-notes/timeline.md 
b/site2/website-next/releases-notes/timeline.md
new file mode 100644
index 0000000..28d1489
--- /dev/null
+++ b/site2/website-next/releases-notes/timeline.md
@@ -0,0 +1,7 @@
+---
+id: timeline
+title: Timeline
+sidebar_label: Timeline 
+---
+
+coming soon...
\ No newline at end of file
diff --git a/site2/website-next/sidebarsReleasesNotes.js 
b/site2/website-next/sidebarsReleasesNotes.js
new file mode 100644
index 0000000..a79c5c2
--- /dev/null
+++ b/site2/website-next/sidebarsReleasesNotes.js
@@ -0,0 +1,47 @@
+// const sidebarJson = require("./sidebars.json");
+
+// module.exports = {
+//   docsSidebar: [
+//     // {
+//     //   type: "doc",
+//     //   id: "releases-notes",
+//     // },
+//     {
+//       type: "category",
+//       label: "Releases Notes",
+//       items: ["all"],
+//     },
+//   ],
+// };
+
+module.exports = {
+  docs: [
+    // {
+    //   type: "autogenerated",
+    //   dirName: ".",
+    // },
+    {
+      type: "doc",
+      id: "all",
+    },
+    {
+      type: "doc",
+      id: "timeline",
+    },
+    // {
+    //   type: "link",
+    //   href: "/showcase",
+    //   label: "Showcase",
+    // },
+    // {
+    //   type: "link",
+    //   href: "/feature-requests",
+    //   label: "Feature Requests",
+    // },
+    // {
+    //   type: "link",
+    //   label: "Chat with us on Discord",
+    //   href: "https://discord.gg/docusaurus";,
+    // },
+  ],
+};
diff --git a/site2/website-next/src/components/VersionsTable.js 
b/site2/website-next/src/components/VersionsTable.js
index ad76263..e2d9e10 100644
--- a/site2/website-next/src/components/VersionsTable.js
+++ b/site2/website-next/src/components/VersionsTable.js
@@ -59,7 +59,7 @@ export default function VersionsTable(props) {
                 href={
                   row.name == "next"
                     ? repoUrl
-                    : `${siteConfig.baseUrl}release-notes#${row.name}`
+                    : 
`${siteConfig.baseUrl}releases-notes#${row.name.replace(/\./g, '')}`
                 }
                 underline="none"
               >

Reply via email to