From c7d57baf82adbf7e5c92935e7ea5e3389bcd50bf Mon Sep 17 00:00:00 2001 From: LofiSu <163713803+LofiSu@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:01:19 +0800 Subject: [PATCH] [Feat]Add new sections HomePageLanguageCard and HomePageCode (#177) "Add new sections HomePageLanguageCard and HomePageCode with Corresponding links . Added some basic configurations" https://github.com/user-attachments/assets/2e93e064-2698-4c5d-a111-ae019f9d5a5a --- babel.config.js | 2 +- docusaurus.config.ts | 1 + package.json | 7 +- src/components/HomePageLanguageCard/index.tsx | 79 ++++++++++++++++++ src/components/HomepageCode/index.tsx | 72 ++++++++++++++++ src/pages/index.tsx | 16 +++- static/JavaScript.svg | 1 + static/Rust.svg | 1 + static/cat.svg | 1 + static/golang.svg | 1 + static/home/coding.svg | 82 +++++++++++++++++++ static/java.svg | 1 + static/more.svg | 1 + static/programming.svg | 1 + static/python.svg | 1 + 15 files changed, 263 insertions(+), 4 deletions(-) create mode 100644 src/components/HomePageLanguageCard/index.tsx create mode 100644 src/components/HomepageCode/index.tsx create mode 100644 static/JavaScript.svg create mode 100644 static/Rust.svg create mode 100644 static/cat.svg create mode 100644 static/golang.svg create mode 100644 static/home/coding.svg create mode 100644 static/java.svg create mode 100644 static/more.svg create mode 100644 static/programming.svg create mode 100644 static/python.svg diff --git a/babel.config.js b/babel.config.js index e00595dae..bfd75dbdf 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: [require.resolve('@docusaurus/core/lib/babel/preset')], + presets: [require.resolve("@docusaurus/core/lib/babel/preset")], }; diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 5ac8ac80d..db6778713 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -77,6 +77,7 @@ const config: Config = { plugins: [ require.resolve('docusaurus-lunr-search') ], + themeConfig: { metadata: [ {'http-equiv': 'Content-Security-Policy', content: "frame-src 'self' https://ghbtns.com"}, diff --git a/package.json b/package.json index 45c87c262..372823a48 100644 --- a/package.json +++ b/package.json @@ -20,17 +20,22 @@ "@docusaurus/plugin-content-docs": "^3.5.1", "@docusaurus/preset-classic": "3.0.1", "@mdx-js/react": "^3.0.0", + "antd": "^5.20.3", "aos": "^2.3.4", "clsx": "^2.0.0", "docusaurus-lunr-search": "^3.3.1", "prism-react-renderer": "^2.3.0", "react": "^18.0.0", - "react-dom": "^18.0.0" + "react-dom": "^18.0.0", + "react-syntax-highlighter": "^15.5.0" }, "devDependencies": { "@docusaurus/module-type-aliases": "3.0.1", "@docusaurus/tsconfig": "3.0.1", "@docusaurus/types": "3.0.1", + "css-loader": "^7.1.2", + "esbuild-loader": "^4.2.2", + "style-loader": "^4.0.0", "typescript": "~5.2.2" }, "browserslist": { diff --git a/src/components/HomePageLanguageCard/index.tsx b/src/components/HomePageLanguageCard/index.tsx new file mode 100644 index 000000000..39b3050ea --- /dev/null +++ b/src/components/HomePageLanguageCard/index.tsx @@ -0,0 +1,79 @@ +import React from "react"; +import { Card } from "antd"; + +export const HomePageLanguageCard = () => ( +
Choose a language to get started .
+