You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2021/02/18 08:17:24 UTC

[apisix-website] branch master updated: fix: error when building website (#190)

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

juzhiyuan 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 a9b767e  fix: error when building website (#190)
a9b767e is described below

commit a9b767eb3a6a90ce00b3ee069cc634860eb92181
Author: qier222 <qi...@outlook.com>
AuthorDate: Thu Feb 18 16:17:16 2021 +0800

    fix: error when building website (#190)
---
 website/.babelrc                           |  3 ---
 website/babel.config.js                    |  4 ++++
 website/docusaurus.config.js               |  3 +++
 website/src/pages/downloads/ProjectCard.js | 38 +++++++++++++++++++++++-------
 4 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/website/.babelrc b/website/.babelrc
deleted file mode 100644
index 84a20a0..0000000
--- a/website/.babelrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
-  "plugins": ["babel-plugin-styled-components"]
-}
diff --git a/website/babel.config.js b/website/babel.config.js
new file mode 100644
index 0000000..82ab31e
--- /dev/null
+++ b/website/babel.config.js
@@ -0,0 +1,4 @@
+module.exports = {
+  presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
+  plugins: ["babel-plugin-styled-components"],
+};
diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js
index 54612e8..8f189c3 100644
--- a/website/docusaurus.config.js
+++ b/website/docusaurus.config.js
@@ -17,6 +17,7 @@ module.exports = {
     downloads: [
       {
         name: "APISIX™",
+        nameInParamCase: "apisix",
         description: "A dynamic, real-time, high-performance API gateway.",
         shape: "triangle",
         color: "var(--ifm-color-primary)",
@@ -26,6 +27,7 @@ module.exports = {
       },
       {
         name: "APISIX™ Dashboard",
+        nameInParamCase: "dashboard",
         description:
           "Designed to make it as easy as possible for users to operate Apache APISIX through a frontend interface.",
         shape: "square",
@@ -36,6 +38,7 @@ module.exports = {
       },
       {
         name: "APISIX™ Ingress Controller",
+        nameInParamCase: "ingress-controller",
         description: "An Apache APISIX control plane component.",
         shape: "hexagon",
         color: "#2563EB",
diff --git a/website/src/pages/downloads/ProjectCard.js b/website/src/pages/downloads/ProjectCard.js
index 4949d51..ed9a86a 100644
--- a/website/src/pages/downloads/ProjectCard.js
+++ b/website/src/pages/downloads/ProjectCard.js
@@ -1,7 +1,6 @@
 import React, { useState, useRef, useEffect } from "react";
 import styled from "styled-components";
 import useOutsideClick from "../../hooks/useOutsideClick";
-import { paramCase } from "change-case";
 
 import IconInfo from "../../assets/icons/info.svg";
 import IconStar from "../../assets/icons/star.svg";
@@ -31,6 +30,7 @@ const ProjectCard = (props) => {
   const [repoStats, setRepoStats] = useState({ stars: 0, issues: 0 });
   const {
     name,
+    nameInParamCase,
     description,
     shape,
     color,
@@ -46,9 +46,11 @@ const ProjectCard = (props) => {
     ) : (
       <IconHexagon />
     );
-  const downloadLink = `https://www.apache.org/dyn/closer.cgi/apisix${
-    "/" + paramCase(name.replace("APISIX™", ""))
-  }/${version}/apache-${paramCase(name.replace("™", ""))}-${version}-src`;
+  const downloadLink = `apisix${
+    nameInParamCase !== "apisix" ? "/" + nameInParamCase : ""
+  }/${version}/apache-${
+    nameInParamCase !== "apisix" ? "apisix-" + nameInParamCase : "apisix"
+  }-${version}-src`;
 
   useEffect(() => {
     getGitHubRepoStats(githubRepo).then((stats) => {
@@ -107,13 +109,22 @@ const ProjectCard = (props) => {
             isDropdownOpen={isDropdownOpen}
             setIsDropdownOpen={setIsDropdownOpen}
           >
-            <DropdownItem href={`${downloadLink}.tgz`} target="_blank">
+            <DropdownItem
+              href={`https://www.apache.org/dyn/closer.cgi/${downloadLink}.tgz`}
+              target="_blank"
+            >
               Source
             </DropdownItem>
-            <DropdownItem href={`${downloadLink}.tgz.asc`} target="_blank">
+            <DropdownItem
+              href={`https://downloads.apache.org/${downloadLink}.tgz.asc`}
+              target="_blank"
+            >
               ASC
             </DropdownItem>
-            <DropdownItem href={`${downloadLink}.tgz.sha512`} target="_blank">
+            <DropdownItem
+              href={`https://downloads.apache.org/${downloadLink}.tgz.sha512`}
+              target="_blank"
+            >
               SHA512
             </DropdownItem>
           </Dropdown>
@@ -151,14 +162,25 @@ const LeftSide = styled.div`
   flex-shrink: 2;
   padding-left: 0.6rem;
 `;
-const Title = styled.div`
+const Title = styled.a`
   font-size: 2.4rem;
   font-weight: bold;
   margin-top: -6px;
+  display: block;
+  cursor: pointer;
   @media (max-width: 600px) {
     margin-top: 0px;
     font-size: 1.6rem;
   }
+  svg {
+    transition: all 0.6s;
+  }
+  &:hover {
+    color: inherit;
+    svg {
+      transform: rotate(360deg);
+    }
+  }
 `;
 const Description = styled.div`
   color: #374151;