Skip to content

Commit

Permalink
refactor: 重构
Browse files Browse the repository at this point in the history
  • Loading branch information
agoodbook committed Mar 18, 2024
1 parent 5004a34 commit 859517a
Show file tree
Hide file tree
Showing 35 changed files with 270 additions and 1,129 deletions.
12 changes: 0 additions & 12 deletions docs/books.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions docs/frontend.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import {FrontendData as Data} from "../src/data";

<NavigationList title="WebSocket实时通讯框架" dataSource={Data.RealTimeCommunicationFrame}/>

<NavigationList title="UI组件库" dataSource={Data.UIComponentsLibrary}/>

<NavigationList title="前端开发构建工具" dataSource={Data.FrontendDevelopmentBuildTools}/>

<NavigationList title="移动端框架" dataSource={Data.MobileEndFrame}/>
Expand All @@ -35,4 +33,3 @@ import {FrontendData as Data} from "../src/data";

<NavigationList title="探索前端技术" dataSource={Data.ExploreFrontendTechnologies}/>

<NavigationList title="包管理器" dataSource={Data.PackageManager}/>
30 changes: 0 additions & 30 deletions docs/guide.mdx

This file was deleted.

1 change: 1 addition & 0 deletions docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 开始
4 changes: 2 additions & 2 deletions docs/plugin-library/nprogress.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import NProgressStyle from "../../src/components/NProgress/NProgressStyle";
import Index from "../../src/components/NProgress";
import NProgressShowCase from "../../src/components/NProgress/NProgressShowCase";
import ConfigAction from "../../src/components/NProgress/ConfigAction";

Expand Down Expand Up @@ -55,7 +55,7 @@ NProgress.isRendered() //检查进度条是否已经被渲染。返回值boolean
border-left-color: #2e8555 !important;
}
```
<NProgressStyle/>
<Index/>


## 项目引用
Expand Down
79 changes: 0 additions & 79 deletions docs/started.mdx

This file was deleted.

14 changes: 0 additions & 14 deletions docs/storeroom.mdx

This file was deleted.

13 changes: 0 additions & 13 deletions docs/up-projects.mdx

This file was deleted.

102 changes: 11 additions & 91 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
import { themes as prismThemes } from "prism-react-renderer";
import type { Config } from "@docusaurus/types";
import type * as Preset from "@docusaurus/preset-classic";

const username: string = "agoodbook";
const repo: string = "agoodbook.github.io";
let config: Config;
config = {
title: "AGoodBook", // 站点名称
tagline: "书山有路勤为径,学海无涯苦作舟", // slogan,标语

let config: Config = {
title: "AGoodBook",
tagline: "书山有路勤为径,学海无涯苦作舟",
favicon: "img/favicon.ico",
trailingSlash: true,

// 配置网站站点url
url: `https://agoodbook.github.io/`,
// 仅agoodbook.github.io仓库使用 '/', 其它仓库页面一律使用 '/<projectName>/'
baseUrl: "/",

// GitHub部署配置
organizationName: username, // 用户名
projectName: repo, // 仓库名
organizationName: username,
projectName: repo,
deploymentBranch: "gh-pages",

onBrokenLinks: "throw",
Expand Down Expand Up @@ -47,30 +45,9 @@ config = {
docs: {
sidebarPath: "./sidebars.ts",
editUrl: `https://github.com/${username}/${repo}/tree/main`,
lastVersion: "current",
remarkPlugins: [
[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }],
],
versions: {
current: {
label: "5.x",
},
"4.0.0": {
label: "4.0.0",
path: "4.0.0",
banner: "none",
},
"3.0.0": {
label: "3.0.0",
path: "3.0.0",
banner: "none",
},
"2.0.0": {
label: "2.0.0",
path: "2.0.0",
banner: "none",
},
},
},
theme: {
customCss: "./src/css/custom.css",
Expand All @@ -85,32 +62,24 @@ config = {
autoCollapseCategories: true,
},
},
versions: {
"2.0.0": "versioned_docs/version-2.0.0",
"3.0.0": "versioned_docs/version-3.0.0",
"4.0.0": "versioned_docs/version-4.0.0",
"5.0.0": "docs",
// 添加更多版本...
},
themes: ["@docusaurus/theme-search-algolia"],
algolia: {
appId: "X1Z85QJPUV",
apiKey: "bf7211c161e8205da2f933a02534105a",
indexName: "docusaurus-2",
},
// Replace with your project's social card
image: "img/docusaurus-social-card.jpg",
navbar: {
title: "AGoodBook", // 导航上站点名称
title: "AGoodBook",
logo: {
alt: "AGoodBook", // 站点 logo 文字替换
src: "img/logo.svg", // 站点 logo 链接
alt: "AGoodBook",
src: "img/logo.svg",
},
items: [
{
type: "doc",
position: "left",
docId: "started",
docId: "index",
label: "文档",
},
{ to: "docs/frontend", label: "前端", position: "left" },
Expand All @@ -121,55 +90,6 @@ config = {
position: "left",
className: "custom-search",
},
{
type: "html",
position: "right",
value: `
<button>Give Feedback</button>
<form class="send-container">
<div class="email">
<input id="feedback-email" type="email" placeholder="您的邮箱"/>
</div>
<div class="content">
<textarea id="feedback-content" placeholder="您反馈什么?"></textarea>
</div>
<div class="tips"></div>
<footer>
<div class="emoji-container">
<img src="/icons/happy.svg" data-emoji="happy" width="24" height="24" alt="happy"/>
<img src="/icons/normal.svg" data-emoji="normal" width="24" height="24" alt="normal"/>
<img src="/icons/sad.svg" data-emoji="sad" width="24" height="24" alt="sad"/>
<img src="/icons/angry.svg" data-emoji="angry" width="24" height="24" alt="angry"/>
</div>
<button class="send-btn" onclick="event.preventDefault()">发送</button>
</footer>
</form>
`,
className: "custom-feedback",
},
// right
{ to: "docs/books", label: "藏书阁", position: "right" },
{ to: "docs/up-projects", label: "创意工坊", position: "right" },
{ to: "docs/storeroom", label: "杂物库", position: "right" },

{
type: "docsVersionDropdown",
position: "right",
},
{
type: "localeDropdown",
position: "right",
dropdownItemsAfter: [
{
type: "html",
value: '<hr style="margin: 0.3rem 0;">',
},
{
href: `https://github.com/${username}/${repo}/issues/3526`,
label: "帮助我们翻译",
},
],
},
{
href: `https://github.com/${username}/${repo}`,
label: "GitHub",
Expand Down
11 changes: 1 addition & 10 deletions sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,7 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";

const sidebars: SidebarsConfig = {
docs: [
{
type: "doc",
id: "started",
label: "介绍",
},
{
type: "doc",
id: "guide",
label: "指南",
},
"index",
{
type: "doc",
id: "actions",
Expand Down
22 changes: 22 additions & 0 deletions src/assets/icons/CategorySvg.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from "react";

function CategorySvg({ width = 40, height = 40 }) {
return (
<svg
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
width={width}
height={height}
>
s
<path
d="M1004.512 444.256l-160-256c-23.36-37.408-64.384-60.16-108.512-60.16l-608 0c-70.688 0-128 57.312-128 128l0 512c0 70.688 57.312 128 128 128l608 0c44.128 0 85.12-22.752 108.512-60.192l160-256c25.984-41.44 25.984-94.144 0-135.648zM950.24 545.984l-160 256.064c-11.744 18.816-32.064 30.048-54.24 30.048l-608 0c-35.296 0-64-28.736-64-64l0-512c0-35.296 28.704-64 64-64l608 0c22.176 0 42.496 11.264 54.24 30.048l160 256c12.896 20.64 12.896 47.264 0 67.84zM736 416.096c-53.056 0-96 42.976-96 96s42.944 96 96 96c52.992 0 96-43.008 96-96 0-53.024-43.008-96-96-96zM736 576.128c-35.36 0-64-28.672-64-64s28.64-64 64-64c35.328 0 64 28.672 64 64s-28.672 64-64 64z"
fill="currentColor"
stroke="currentColor"
strokeWidth="2"
></path>
</svg>
);
}

export default CategorySvg;
Loading

0 comments on commit 859517a

Please sign in to comment.