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

xiaoyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shenyu-website.git


The following commit(s) were added to refs/heads/main by this push:
     new e3f84f6096 [type: feature] docs page update (#761)
e3f84f6096 is described below

commit e3f84f6096125a6dbf8224761850440107da6a41
Author: gouzixing <[email protected]>
AuthorDate: Mon Sep 26 14:20:57 2022 +0800

    [type: feature] docs page update (#761)
    
    * newsPage
    
    * news page
    
    * bugfix
    
    * news page update
    
    * bugfix --path bug
    
    * conflict
    
    * conflict
    
    * img update
    
    * blog page refractor
    
    * blog page new style
    
    * delete annotate
    
    * index page highlight for slogon
    
    * bugfix:document for node
    
    * bugfix--link false
    
    * i18n & link fix
    
    * 'translate'
    
    * translate
    
    * urlchange bugfix
    
    * docs fix
    
    * delete unused import
    
    * fix
    
    * event page & navibar update & overview doc & pic update for news
    
    * lint
    
    * lint
    
    * translate
    
    * lint
    
    * trans
    
    * feat
    
    * fix--locale=zh
    
    * docs fix
    
    * footer
    
    * i18n
    
    * userList
    
    * fix
    
    * fix
    
    * fix
    
    * index
    
    * fix
    
    * hover
    
    * fix
    
    * index page
    
    * index page
    
    * SWIPER
    
    * SWIPER
    
    * 2.5.0
    
    * 2.5.0
    
    * 2.5.0
    
    * 适配
    
    * 适配
    
    * download
    
    * download
    
    * download
    
    * download
    
    * download
    
    * blog info
    
    * i18n
    
    * grammarly
    
    * grammar
    
    * chinglish fix
    
    * docs page
    
    * doc
    
    * doc
    
    * doc
    
    * doc
    
    Co-authored-by: gouzixing <[email protected]>
    Co-authored-by: gouzixing <[email protected]>
    Co-authored-by: gouzixing <gouzixing>
---
 docusaurus.config.js                               | 157 ++-----------------
 i18n/zh/code.json                                  |  35 ++++-
 shenyuNginx/index.md                               | 170 +++++++++++++++++++++
 shenyuNginx_versioned_docs/version-cur/index.md    | 170 +++++++++++++++++++++
 .../version-cur-sidebars.json                      |   9 ++
 shenyuNginx_versions.json                          |   3 +
 src/data/docsInfo.js                               |  32 ++++
 src/pages/document.module.css                      | 135 ++++++++++++++++
 src/pages/document.tsx                             | 106 +++++++++++++
 9 files changed, 675 insertions(+), 142 deletions(-)

diff --git a/docusaurus.config.js b/docusaurus.config.js
index 3aed1a740d..d918b018ff 100755
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -27,9 +27,7 @@ module.exports = {
     },
   },
   themeConfig: {
-
     navbar: {
-     // title: 'Apache ShenYu',
       logo: {
         alt: 'Apache ShenYu Logo',
         src: 'img/logo.svg',
@@ -37,56 +35,7 @@ module.exports = {
       },
       items: [
         {to: '/download', label: 'Download', position: 'right'},
-        // {
-        //   type: 'docsVersionDropdown',
-        //   label: 'doc',
-        //   position: 'left',
-        //   dropdownActiveClassDisabled: true,
-        //   dropdownItemsAfter: [
-        //     {
-        //       to: '/versions',
-        //       label: 'All versions',
-        //     },
-        //   ],
-        // },
-        {
-          label: 'Docs',
-          position: 'right',
-          items: [
-            {
-              label: "master",
-              to: "/docs/next/index",
-            },
-            {
-              label: "2.5.0",
-              to: "/docs/index",
-            },
-            {
-              label: "2.4.3",
-              to: "/docs/2.4.3/index",
-            },
-            {
-              label: "2.4.2",
-              to: "/docs/2.4.2/index",
-            },
-            {
-              label: "2.4.1",
-              to: "/docs/2.4.1/index",
-            },
-            {
-              label: "2.4.0",
-              to: "/docs/2.4.0/index",
-            },
-            {
-              label: "2.3.0-Legacy",
-              to: "/docs/2.3.0-Legacy/index",
-            },
-            {
-              label: "All Versions",
-              to: "/versions",
-            },
-          ],
-        },
+        {to: '/document', label: 'Docs', position: 'right'},
         {
           to: '/community/contributor-guide',
           label: 'Community',
@@ -148,81 +97,6 @@ module.exports = {
         },
       ],
     },
-    // footer: {
-    //   style: 'dark',
-    //   links: [
-    //     {
-    //       title: 'Events',
-    //       items: [
-    //         {
-    //           label: 'ApacheCon',
-    //           href: 'https://www.apachecon.com',
-    //         },
-    //       ],
-    //     },
-    //     {
-    //       title: 'ShenYu',
-    //       items: [
-    //         {
-    //           label: 'Download',
-    //           to: '/download',
-    //         },
-    //         {
-    //           label: 'Document',
-    //           to: '/docs/index',
-    //         },
-    //         {
-    //           label: 'News',
-    //           to: '/news',
-    //         },
-    //         {
-    //           label: 'Blog',
-    //           to: '/blog',
-    //         },
-    //         {
-    //           label: 'Releases',
-    //           href: 'https://github.com/apache/shenyu/releases',
-    //         },
-    //       ],
-    //     },
-    //     {
-    //       title: 'Community',
-    //       items: [
-    //         {
-    //           label: 'Community',
-    //           to: '/community/contributor-guide',
-    //         },
-    //         {
-    //           label: 'GitHub',
-    //           href: 'https://github.com/apache/shenyu',
-    //         },
-    //         {
-    //           label: 'Issue Tracker',
-    //           href: 'https://github.com/apache/shenyu/issues',
-    //         },
-    //       ],
-    //     },
-    //     {
-    //       title: 'Subscribe mailing list',
-    //       items: [
-    //         {
-    //           label: 'How to subscribe',
-    //           to: '/community/contributor-guide#join-the-discussion',
-    //         },
-    //         {
-    //           label: 'Subscribe Mail',
-    //           href: 'mailto://[email protected]',
-    //         },
-    //         {
-    //           label: 'Mail Archive',
-    //           href: 
'https://lists.apache.org/[email protected]',
-    //         },
-    //       ],
-    //     },
-    //   ],
-    //   copyright: `<div>< img style="height:50px; margin-right:10px" 
src="/img/logo/support-apache.png" /> < img style="height:50px; 
margin-left:10px" alt="Apache Software Foundation" src="/img/logo/asf_logo.svg" 
/><p style="color:#ffffffcf;font-size:14px;text-align:center">Copyright  ${new 
Date().getFullYear()} The Apache Software Foundation, Licensed under the Apache 
License, Version 2.0. Apache ShenYu,  Apache, the Apache feather logo, the 
Apache ShenYu logo are trademarks of The Ap [...]
-    //   <div>`,
-    // },
     prism: {
       theme: lightCodeTheme,
       darkTheme: darkCodeTheme,
@@ -281,20 +155,21 @@ module.exports = {
         showLastUpdateTime: true,
       },
     ],
-    // [
-    //   '@docusaurus/plugin-content-docs',
-    //   {
-    //     id: 'download',
-    //     path: 'download',
-    //     routeBasePath: 'download',
-    //     editUrl: ({locale, versionDocsDirPath, docPath}) => {
-    //       if (locale !== 'en') {
-    //         return 
`https://github.com/apache/incubator-shenyu-website/edit/main/i18n/${locale}/docusaurus-plugin-content-docs-event/current/${docPath}`;
-    //       }
-    //       return 
`https://github.com/apache/incubator-shenyu-website/edit/main/${versionDocsDirPath}/${docPath}`;
-    //     },
-    //   }
-    // ],
+    [
+      '@docusaurus/plugin-content-docs',
+      {
+        id: 'shenyuNginx',
+        path: 'shenyuNginx',
+        routeBasePath: 'shenyuNginx',
+        disableVersioning: false,
+        includeCurrentVersion: true,
+        editCurrentVersion: true,
+        editLocalizedFiles: true,
+        sidebarPath: require.resolve('./sidebarsCommunity.js'),
+        showLastUpdateAuthor: true,
+        showLastUpdateTime: true,
+      }
+    ],
     [
       '@docusaurus/plugin-content-docs',
       {
diff --git a/i18n/zh/code.json b/i18n/zh/code.json
index 570ee9660d..eb54763d9f 100755
--- a/i18n/zh/code.json
+++ b/i18n/zh/code.json
@@ -514,5 +514,38 @@
   },
   "ShenYu-Bootstrap Binary Distribution":{
     "message": "ShenYu-Bootstrap 二进制包"
-  }
+  },
+  "Document List":{
+    "message": "文档列表"
+  },
+  "This directory presents the official Apache ShenYu repositories and some 
ecosystem projects developed by community.":{
+    "message": "本页面展示了Apache ShenYu及其生态项目的使用文档。"
+  },
+  "The downloadable releases can be find in the":{
+    "message": "可下载的已发布版本下载地址:"
+  },
+  "download page":{
+    "message": "下载地址"
+  },
+  "Apache ShenYu Docs":{
+    "message": "Apache ShenYu 文档"
+  },
+  "ShenYu Nginx Docs":{
+    "message": "ShenYu Nginx 文档"
+  },
+  "The document for Apache ShenYu":{
+    "message": "Apache ShenYu官方文档"
+  },
+  "This module provided SDK to watch available ShenYu instance list as 
upstream nodes by Service Register Center for OpenResty.":{
+    "message": "该模块提供了SDK来监视OpenResty的服务注册中心作为上游节点的可用ShenYu实例列表"
+  },
+  "All Versions":{
+    "message": "所有版本"
+  },
+  "Latest Version":{
+    "message": "最新版本"
+  },
+  "Next Version":{
+    "message": "下一版本"
+  } 
 }
diff --git a/shenyuNginx/index.md b/shenyuNginx/index.md
new file mode 100644
index 0000000000..8b4869605d
--- /dev/null
+++ b/shenyuNginx/index.md
@@ -0,0 +1,170 @@
+---
+description: Apache ShenYu Nginx Module(Experimental)
+title: Overview
+---
+
+# Apache ShenYu Nginx Module(Experimental)
+
+This module provided SDK to watch available ShenYu instance list as upstream 
nodes by Service Register Center for OpenResty.
+1. [ETCD](#greeting-etcd) (Supported)
+2. [Nacos](#greeting-nacos) (Supported)
+3. [Zookeeper](#greeting-zookeeper) (Supported)
+4. Consul (TODO)
+
+In the cluster mode, Apache ShenYu supports the deployment of multiple ShenYu 
instances, which may have new instances joining or leaving at any time.
+Hence, Apache ShenYu introduces Service Discovery modules to help client to 
detect the available instances. 
+Currently, Apache ShenYu Bootstrap already supports Apache Zookeeper, Nacos, 
Etcd, and consul. Client or LoadBalancer can get the available ShenYu instances 
by those Service register center. 
+
+## Getting Started
+
+- Prerequisite:
+1. Luarocks
+2. OpenResty
+
+### Build from source
+
+The first, clone the source from GitHub.
+
+```shell
+git clone https://github.com/apache/incubator-shenyu-nginx
+```
+
+Then, build from source and install.
+
+```shell
+cd incubator-shenyu-nginx
+luarocks make rockspec/shenyu-nginx-main-0.rockspec
+```
+
+### Greeting ETCD
+
+Modify the Nginx configure, create and initialize the ShenYu Register to 
connect to the target register center. 
+The module will fetch the all of ShenYu instances which are registered to Etcd 
in the same cluster.
+It works like Etcd client to watch(based on long polling) ShenYu instance 
lists. 
+
+Here is an example for Etcd.
+
+```
+init_worker_by_lua_block {
+    local register = require("shenyu.register.etcd")
+    register.init({
+        balancer_type = "chash",
+        etcd_base_url = "http://127.0.0.1:2379";,
+    })
+}
+```
+
+1. `balancer_type` specify the balancer. It has supported `chash` and `round 
robin`.
+2. `etcd_base_url` specify the Etcd server.(Currently, authentication is not 
supported.)
+
+Add an `upstream block` for ShenYu and enable to update upstream servers 
dynamically. This case will synchronize the ShenYu instance list with register 
center. 
+And then pick one up for handling the request.
+
+```
+upstream shenyu {
+    server 0.0.0.1; -- bad 
+    
+    balancer_by_lua_block {
+        require("shenyu.register.etcd").pick_and_set_peer()
+    }
+}
+```
+
+Finally, restart OpenResty.
+
+```shell
+openresty -s reload
+```
+
+Here is a completed 
[example](https://github.com/apache/incubator-shenyu-nginx/blob/main/example/etcd/nginx.conf)
 working with ETCD.
+
+### Greeting Nacos
+
+Modify the Nginx configure, create and initialize the ShenYu Register to 
connect to target register center.  Here is an example for Nacos.
+
+```
+init_worker_by_lua_block {
+    local register = require("shenyu.register.nacos")
+    register.init({
+        shenyu_storage = ngx.shared.shenyu_storage,
+        balancer_type = "chash",
+        nacos_base_url = "http://127.0.0.1:8848";,
+        username = "nacos",
+        password = "naocs",
+    })
+}
+```
+
+1. `balancer_type` specify the balancer. It has supported `chash` and `round 
robin`.
+2. `nacos_base_url` specify the Nacos server address.
+3. `username` specify the username to log in Nacos. (it is only required when 
Nacos auth enable)
+4. `password` specify the password to log in Nacos.
+
+Modify the `upstream` to enable to update upstream servers dynamically. This 
case will synchronize the ShenYu instance list with register center. 
+And then pick one up for handling the request.
+
+```
+upstream shenyu {
+    server 0.0.0.1; -- bad 
+    
+    balancer_by_lua_block {
+        require("shenyu.register.nacos").pick_and_set_peer()
+    }
+}
+```
+
+Finally, restart OpenResty.
+
+```shell
+openresty -s reload
+```
+
+Here is a completed 
[example](https://github.com/apache/incubator-shenyu-nginx/blob/main/example/nacos/nginx.conf)
 working with Nacos.
+
+## Greeting Zookeeper 
+
+Modify the Nginx configure, create and initialize the ShenYu register to 
connect to target register center.
+Listen for changes to the node via the zookeeper watch event. Here is an 
example of the zookeeper configuration.
+
+```shell
+init_worker_by_lua_block {
+        local register = require("shenyu.register.zookeeper")
+        register.init({
+           servers = {"127.0.0.1:2181","127.0.0.1:2182"},
+           shenyu_storage = ngx.shared.shenyu_storage,
+           balancer_type = "roundrobin"
+        });
+    }
+```
+
+1. `servers` zookeeper cluster address.
+2. ``balancer_type`` specify the balancer. It has supported `chash` and `round 
robin`.
+
+Modify the upstream to enable to update upstream servers dynamically. This 
case will synchronize the ShenYu instance list with register center. And then 
pick one up for handling the request.
+
+```shell
+ upstream shenyu {
+        server 0.0.0.1;
+        balancer_by_lua_block {
+            require("shenyu.register.zookeeper").pick_and_set_peer()
+        }
+    }
+```
+
+Finally, restart OpenResty.
+
+```shell
+openresty -s reload
+```
+
+Here is a completed 
[example](https://github.com/apache/incubator-shenyu-nginx/blob/main/example/zookeeper/nginx.conf)
 working with Zookeeper.
+
+
+## Contributor and Support
+
+* [How to Contributor](https://shenyu.apache.org/community/contributor-guide)
+* [Mailing Lists](mailto:[email protected])
+
+## License
+
+[Apache License 2.0](https://apache.org/licenses/LICENSE-2.0)
diff --git a/shenyuNginx_versioned_docs/version-cur/index.md 
b/shenyuNginx_versioned_docs/version-cur/index.md
new file mode 100644
index 0000000000..8b4869605d
--- /dev/null
+++ b/shenyuNginx_versioned_docs/version-cur/index.md
@@ -0,0 +1,170 @@
+---
+description: Apache ShenYu Nginx Module(Experimental)
+title: Overview
+---
+
+# Apache ShenYu Nginx Module(Experimental)
+
+This module provided SDK to watch available ShenYu instance list as upstream 
nodes by Service Register Center for OpenResty.
+1. [ETCD](#greeting-etcd) (Supported)
+2. [Nacos](#greeting-nacos) (Supported)
+3. [Zookeeper](#greeting-zookeeper) (Supported)
+4. Consul (TODO)
+
+In the cluster mode, Apache ShenYu supports the deployment of multiple ShenYu 
instances, which may have new instances joining or leaving at any time.
+Hence, Apache ShenYu introduces Service Discovery modules to help client to 
detect the available instances. 
+Currently, Apache ShenYu Bootstrap already supports Apache Zookeeper, Nacos, 
Etcd, and consul. Client or LoadBalancer can get the available ShenYu instances 
by those Service register center. 
+
+## Getting Started
+
+- Prerequisite:
+1. Luarocks
+2. OpenResty
+
+### Build from source
+
+The first, clone the source from GitHub.
+
+```shell
+git clone https://github.com/apache/incubator-shenyu-nginx
+```
+
+Then, build from source and install.
+
+```shell
+cd incubator-shenyu-nginx
+luarocks make rockspec/shenyu-nginx-main-0.rockspec
+```
+
+### Greeting ETCD
+
+Modify the Nginx configure, create and initialize the ShenYu Register to 
connect to the target register center. 
+The module will fetch the all of ShenYu instances which are registered to Etcd 
in the same cluster.
+It works like Etcd client to watch(based on long polling) ShenYu instance 
lists. 
+
+Here is an example for Etcd.
+
+```
+init_worker_by_lua_block {
+    local register = require("shenyu.register.etcd")
+    register.init({
+        balancer_type = "chash",
+        etcd_base_url = "http://127.0.0.1:2379";,
+    })
+}
+```
+
+1. `balancer_type` specify the balancer. It has supported `chash` and `round 
robin`.
+2. `etcd_base_url` specify the Etcd server.(Currently, authentication is not 
supported.)
+
+Add an `upstream block` for ShenYu and enable to update upstream servers 
dynamically. This case will synchronize the ShenYu instance list with register 
center. 
+And then pick one up for handling the request.
+
+```
+upstream shenyu {
+    server 0.0.0.1; -- bad 
+    
+    balancer_by_lua_block {
+        require("shenyu.register.etcd").pick_and_set_peer()
+    }
+}
+```
+
+Finally, restart OpenResty.
+
+```shell
+openresty -s reload
+```
+
+Here is a completed 
[example](https://github.com/apache/incubator-shenyu-nginx/blob/main/example/etcd/nginx.conf)
 working with ETCD.
+
+### Greeting Nacos
+
+Modify the Nginx configure, create and initialize the ShenYu Register to 
connect to target register center.  Here is an example for Nacos.
+
+```
+init_worker_by_lua_block {
+    local register = require("shenyu.register.nacos")
+    register.init({
+        shenyu_storage = ngx.shared.shenyu_storage,
+        balancer_type = "chash",
+        nacos_base_url = "http://127.0.0.1:8848";,
+        username = "nacos",
+        password = "naocs",
+    })
+}
+```
+
+1. `balancer_type` specify the balancer. It has supported `chash` and `round 
robin`.
+2. `nacos_base_url` specify the Nacos server address.
+3. `username` specify the username to log in Nacos. (it is only required when 
Nacos auth enable)
+4. `password` specify the password to log in Nacos.
+
+Modify the `upstream` to enable to update upstream servers dynamically. This 
case will synchronize the ShenYu instance list with register center. 
+And then pick one up for handling the request.
+
+```
+upstream shenyu {
+    server 0.0.0.1; -- bad 
+    
+    balancer_by_lua_block {
+        require("shenyu.register.nacos").pick_and_set_peer()
+    }
+}
+```
+
+Finally, restart OpenResty.
+
+```shell
+openresty -s reload
+```
+
+Here is a completed 
[example](https://github.com/apache/incubator-shenyu-nginx/blob/main/example/nacos/nginx.conf)
 working with Nacos.
+
+## Greeting Zookeeper 
+
+Modify the Nginx configure, create and initialize the ShenYu register to 
connect to target register center.
+Listen for changes to the node via the zookeeper watch event. Here is an 
example of the zookeeper configuration.
+
+```shell
+init_worker_by_lua_block {
+        local register = require("shenyu.register.zookeeper")
+        register.init({
+           servers = {"127.0.0.1:2181","127.0.0.1:2182"},
+           shenyu_storage = ngx.shared.shenyu_storage,
+           balancer_type = "roundrobin"
+        });
+    }
+```
+
+1. `servers` zookeeper cluster address.
+2. ``balancer_type`` specify the balancer. It has supported `chash` and `round 
robin`.
+
+Modify the upstream to enable to update upstream servers dynamically. This 
case will synchronize the ShenYu instance list with register center. And then 
pick one up for handling the request.
+
+```shell
+ upstream shenyu {
+        server 0.0.0.1;
+        balancer_by_lua_block {
+            require("shenyu.register.zookeeper").pick_and_set_peer()
+        }
+    }
+```
+
+Finally, restart OpenResty.
+
+```shell
+openresty -s reload
+```
+
+Here is a completed 
[example](https://github.com/apache/incubator-shenyu-nginx/blob/main/example/zookeeper/nginx.conf)
 working with Zookeeper.
+
+
+## Contributor and Support
+
+* [How to Contributor](https://shenyu.apache.org/community/contributor-guide)
+* [Mailing Lists](mailto:[email protected])
+
+## License
+
+[Apache License 2.0](https://apache.org/licenses/LICENSE-2.0)
diff --git a/shenyuNginx_versioned_sidebars/version-cur-sidebars.json 
b/shenyuNginx_versioned_sidebars/version-cur-sidebars.json
new file mode 100644
index 0000000000..d848e1e1ce
--- /dev/null
+++ b/shenyuNginx_versioned_sidebars/version-cur-sidebars.json
@@ -0,0 +1,9 @@
+{
+    "version-cur": [
+      {
+        "type": "autogenerated",
+        "dirName": "."
+      }
+    ]
+  }
+  
\ No newline at end of file
diff --git a/shenyuNginx_versions.json b/shenyuNginx_versions.json
new file mode 100644
index 0000000000..9211313527
--- /dev/null
+++ b/shenyuNginx_versions.json
@@ -0,0 +1,3 @@
+[
+    "cur"
+]
\ No newline at end of file
diff --git a/src/data/docsInfo.js b/src/data/docsInfo.js
new file mode 100644
index 0000000000..fde6f4a75a
--- /dev/null
+++ b/src/data/docsInfo.js
@@ -0,0 +1,32 @@
+import React from 'react';
+import Translate from "@docusaurus/Translate";
+
+export default [
+    {
+      'docsTitle': <Translate>Apache ShenYu Docs</Translate>,
+      'projectName': 'Apache ShenYu',
+      'description': <Translate>The document for Apache ShenYu</Translate>,
+      'latestVersion': 'docs/index',
+      'nextVersion': 'docs/next/index',
+      'versionsList': [
+        { 'next': 'docs/next/index' },
+        { '2.5.0': 'docs/index' },
+        { '2.4.3': 'docs/2.4.3/index' },
+        { '2.4.2': 'docs/2.4.2/index' },
+        { '2.4.1': 'docs/2.4.1/index' },
+        { '2.4.0': 'docs/2.4.0/index' },
+        { '2.3.0-Legacy': 'docs/2.3.0-Legacy/index' },
+      ]
+    },
+    {
+      'docsTitle': <Translate>ShenYu Nginx Docs</Translate>,
+      'projectName': 'ShenYu Nginx',
+      'description': <Translate>This module provided SDK to watch available 
ShenYu instance list as upstream nodes by Service Register Center for 
OpenResty.</Translate>,
+      'latestVersion': 'shenyuNginx/index',
+      'nextVersion': 'shenyuNginx/next/index',
+      'versionsList': [
+        { 'current': 'shenyuNginx/index' }
+      ]
+    }
+  ]
+  
\ No newline at end of file
diff --git a/src/pages/document.module.css b/src/pages/document.module.css
new file mode 100644
index 0000000000..f57173433b
--- /dev/null
+++ b/src/pages/document.module.css
@@ -0,0 +1,135 @@
+.top{
+    height: 180px;
+}
+
+.title{
+    text-align: center;
+    font-size: 1.75rem;
+    color: var(--ifm-color-primary);
+    font-weight: bold;
+    margin: 70px 0 40px 0;
+}
+
+.description{
+    text-align: center;
+}
+
+.descriptionLine{
+    margin: -10px 0 15px 0;
+}
+
+.descriptionLineHref{
+    margin-left: 8px;
+}
+
+.content{
+    min-height: 600px;
+    background-color: #F2F4F7;
+}
+
+.documentList{
+    padding: 30px 200px 30px 200px;
+    display: flex;
+    flex-wrap: wrap;
+}
+
+.docItem{
+    margin: 20px;
+    width: 45%;
+    border-radius: 10px;
+    padding: 10px 20px;
+}
+
+.docsTitle{
+    font-size: 20px;
+    font-weight: bold;
+}
+
+.cardItem{
+    margin: 20px 0px;
+    min-height: 200px;
+    background-color: #FFFFFF;
+    border-radius: 10px;
+    padding: 10px 20px;
+    display: flex;
+    flex-direction: column;
+}
+
+.descriptionCardTitle{
+    font-size: 18px;
+    margin: 10px 0;
+    font-weight: bold;
+}
+
+.descriptionCardDescription{
+    color: #475467;
+    font-size: 15px;
+    margin: 10px 0px;
+}
+
+.descriptionCardLinks{
+    font-size: 16px;
+    display: flex;
+    margin: auto 0 10px 0;
+}
+
+.descriptionCardLinksSpan{
+    margin: 0 8px;
+    color: var(--ifm-link-color);
+}
+
+.downloadCardButton {
+    font-family: inherit;
+    vertical-align: middle;
+    user-select: none;
+    transition: color .15s ease-in-out,background-color .15s 
ease-in-out,border-color .15s ease-in-out,box-shadow .15s 
ease-in-out,-webkit-box-shadow .15s ease-in-out;
+    padding: .25rem .5rem;
+    background-color: #fff;
+    border: 1px solid #d5d5d5;
+    border-radius: 4px;
+    height: 30px;
+    font-size: 16px;
+    color: var(--ifm-link-color);
+}
+
+.downloadCardButton::after {
+    display: inline-block;
+    width: 0;
+    height: 0;
+    margin-left: 0.5em;
+    vertical-align: 0.255em;
+    content: "";
+    border-top: 0.3em solid;
+    border-right: 0.3em solid transparent;
+    border-bottom: 0;
+    border-left: 0.3em solid transparent;
+}
+
+.dropDownContainer{
+    padding: .5rem 0;
+    margin: .125rem 0 0;
+    border: 1px solid rgba(0,0,0,.15);
+    border-radius: .25rem;
+    box-shadow: 0 0.5rem 1rem rgb(0 0 0 / 18%);
+    width: 150px;
+    background-color: #FFF;
+    position: absolute;
+    max-height: 300px;
+    overflow-y: scroll;
+}
+
+.linkItem:hover{
+    background-color: #F2F4F7;
+}
+
+.linkItemA{
+    color: #000;
+    margin: 2px 10px 2px 10px;
+    display: block;
+    width: 100%;
+}
+
+.linkItemA:hover{
+    text-decoration: none;
+    color: #000;
+}
\ No newline at end of file
diff --git a/src/pages/document.tsx b/src/pages/document.tsx
new file mode 100644
index 0000000000..718a5d9c02
--- /dev/null
+++ b/src/pages/document.tsx
@@ -0,0 +1,106 @@
+import React, { useEffect, useState, useCallback } from 'react';
+import Layout from '@theme/Layout';
+import styles from './document.module.css';
+import Translate from "@docusaurus/Translate";
+import { BrowserRouter as Router, Route, Link } from 'react-router-dom'
+import data from '../data/docsInfo';
+
+function Event() {
+  const defaultState = Array(data.length).fill(false)
+  const [showItem, setShowItem] = useState(defaultState);
+
+  const closeList = useCallback(
+    e => {
+      const { target } = e;
+      const value = target.getAttributeNode('id')?.value;
+      if (value && value === 'dropDownButton') {
+        return
+      } else {
+        setShowItem(defaultState);
+      }
+    },
+    [])
+
+  useEffect(
+    () => {
+      document.addEventListener('click', (e) => { closeList(e) });
+      return document.removeEventListener('click', (e) => { closeList(e) });
+    },
+    []
+  );
+
+  const showList = useCallback(
+    index => {
+      const newShowItem = showItem.map((item, key) => {
+        if (key === index) {
+          return !item;
+        } else {
+          return false;
+        }
+      })
+      setShowItem([...newShowItem]);
+    },
+    [showItem]
+  );
+
+  return (
+    <Layout title="Document">
+      <div className={styles.top}>
+        <div className={styles.title}><Translate>Document 
List</Translate></div>
+        <div className={styles.description}>
+          <p className={styles.descriptionLine}><Translate>This directory 
presents the official Apache ShenYu repositories and some ecosystem projects 
developed by community.</Translate></p>
+          <p className={styles.descriptionLine}><Translate>The downloadable 
releases can be find in the</Translate><a 
className={styles.descriptionLineHref} href='./download'><Translate>download 
page</Translate></a></p>
+        </div>
+      </div>
+      <div className={styles.content}>
+        <div className={styles.documentList}>
+          {data.map((item, i) => {
+            const { versionsList } = item;
+            return (
+              <div key={i} className={styles.docItem} >
+                <div className={styles.docsTitle}>{item.docsTitle}</div>
+                <div className={styles.cardItem}>
+                  <div 
className={styles.descriptionCardTitle}>{item.projectName}</div>
+                  <div 
className={styles.descriptionCardDescription}>{item.description}</div>
+                  <div className={styles.descriptionCardLinks}>
+                    <Link to={item.latestVersion}><Translate>Latest 
Version</Translate></Link>
+                    <span className={styles.descriptionCardLinksSpan}> | 
</span>
+                    <Link to={item.nextVersion}><Translate>Next 
Version</Translate></Link>
+                    <span className={styles.descriptionCardLinksSpan}> | 
</span>
+                    <div>
+                      <button id='dropDownButton' 
className={styles.downloadCardButton} onClick={() => { showList(i) 
}}><Translate>All Versions</Translate></button>
+                      {
+                        showItem[i] &&
+                        (
+                          <div className={styles.dropDownContainer}>
+                            {
+                              versionsList.map((item2, index2) => {
+                                const listArr = Object.keys(item2).map(list => 
{
+                                  return {
+                                    title: list,
+                                    link: item2[list],
+                                  }
+                                })
+                                return (
+                                  <div className={styles.linkItem} >
+                                    <Link className={styles.linkItemA} 
to={listArr[0].link}>{listArr[0].title}</Link>
+                                  </div>
+                                )
+                              })
+                            }
+                          </div>
+                        )
+                      }
+                    </div>
+                  </div>
+                </div>
+              </div>
+            )
+          })}
+        </div>
+      </div>
+    </Layout>
+  );
+}
+
+export default Event;
\ No newline at end of file

Reply via email to