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

yilinzeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 3c36444  feat: Add the DockerHub links on Downloads page (#886)
3c36444 is described below

commit 3c364448c8bce48aadbe92600e5eb6d52dd26152
Author: oil欧呦 <[email protected]>
AuthorDate: Mon Feb 21 21:06:17 2022 +0800

    feat: Add the DockerHub links on Downloads page (#886)
---
 website/config/downloads.js                |  3 +++
 website/src/pages/downloads/ProjectCard.js | 37 +++++++++++++++++++-----------
 2 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/website/config/downloads.js b/website/config/downloads.js
index a78dfeb..c1843ec 100644
--- a/website/config/downloads.js
+++ b/website/config/downloads.js
@@ -8,6 +8,7 @@ module.exports = [
     githubRepo: "apache/apisix",
     githubBranch: "master",
     downloadPath: "apisix/2.12.1/apache-apisix-2.12.1-src",
+    dockerhubPath:"apisix",
     version: "2.12.1",
     LTSDownloadPath: "apisix/2.10.4/apache-apisix-2.10.4-src",
     LTSVersion: "2.10.4",
@@ -24,6 +25,7 @@ module.exports = [
     githubRepo: "apache/apisix-dashboard",
     githubBranch: "master",
     downloadPath: "apisix/dashboard/2.10.1/apache-apisix-dashboard-2.10.1-src",
+    dockerhubPath:"apisix-dashboard",
     version: "2.10.1",
     releaseDate: "2021-12-23",
     firstDocPath: "/USER_GUIDE",
@@ -37,6 +39,7 @@ module.exports = [
     githubRepo: "apache/apisix-ingress-controller",
     githubBranch: "master",
     downloadPath: 
"apisix/ingress-controller/1.3.0/apache-apisix-ingress-controller-1.3.0-src",
+    dockerhubPath:"apisix-ingress-controller",
     version: "1.3.0",
     releaseDate: "2021-10-17",
     firstDocPath: "/getting-started",
diff --git a/website/src/pages/downloads/ProjectCard.js 
b/website/src/pages/downloads/ProjectCard.js
index 062708f..54ce89c 100644
--- a/website/src/pages/downloads/ProjectCard.js
+++ b/website/src/pages/downloads/ProjectCard.js
@@ -65,10 +65,12 @@ const ProjectCard = (props) => {
     githubRepo,
     githubBranch,
     downloadPath,
-    LTSDownloadPath = ' '
+    dockerhubPath,
+    LTSDownloadPath = " ",
   } = props;
 
-  const Download = props.name === 'APISIX®' ? `${props.version} Current` : 
'Download'
+  const Download =
+    props.name === "APISIX®" ? `${props.version} Current` : "Download";
 
   const shapeComponent =
     shape === "triangle" ? (
@@ -97,14 +99,14 @@ const ProjectCard = (props) => {
   const LTSButton = () => {
     return (
       <Button
-        style={{ display: (name === 'APISIX®' ? ' ' : 'NONE') }}
+        style={{ display: name === "APISIX®" ? " " : "NONE" }}
         onClick={() => setIsLTSDropdownOpen(!isLTSDropdownOpen)}
         background={color}
       >
-        <IconDownload/> {`${props.LTSVersion} LTS`}
+        <IconDownload /> {`${props.LTSVersion} LTS`}
       </Button>
-    )
-  }
+    );
+  };
 
   return (
     <Card>
@@ -190,6 +192,15 @@ const ProjectCard = (props) => {
               isDropdownOpen={isDropdownOpen}
               setIsDropdownOpen={setIsDropdownOpen}
             >
+              {dockerhubPath ? (
+                <DropdownItem
+                  className="download-dropdown-item"
+                  href={`https://hub.docker.com/r/apache/${dockerhubPath}`}
+                  target="_blank"
+                >
+                  DockerHub
+                </DropdownItem>
+              ) : null}
               <DropdownItem
                 className="download-dropdown-item"
                 
href={`https://www.apache.org/dyn/closer.cgi/${downloadPath}.tgz`}
@@ -325,17 +336,17 @@ const RightSide = styled.div`
   }
 `;
 const LTSCard = styled.div`
-  margin-right: 1.0em;
-  position:relative;
-  display:flex;
+  margin-right: 1em;
+  position: relative;
+  display: flex;
 `;
 const ButtonCard = styled.div`
-  margin-right:0.3em;
-  position:relative;
-  display:flex;
+  margin-right: 0.3em;
+  position: relative;
+  display: flex;
 `;
 const ButtonRow = styled.div`
-  inline-size:auto;
+  inline-size: auto;
   display: flex;
 `;
 const Button = styled.button`

Reply via email to