Skip to content

Commit 83382a8

Browse files
authored
Merge pull request #35 from xlgzsgf/astro
feat: ✨ Rework UI and Improve Responsiveness, Clean Up Codebase
2 parents c78b871 + 15c7ee2 commit 83382a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3986
-1276
lines changed

astro.config.mjs

Lines changed: 8 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,21 @@
11
import { defineConfig } from "astro/config";
22
import starlight from "@astrojs/starlight";
3-
import partytown from "@astrojs/partytown";
4-
import preact from "@astrojs/preact";
53
import { autoImportComponents } from "@serverless-cd/goat-ui/src/utils";
64
import tailwind from "@astrojs/tailwind";
75
import icon from "astro-icon";
8-
// import compress from 'astro-compress';
9-
import rehypeExternalLinks from "rehype-external-links";
10-
11-
import {
12-
addPrefixImageLink,
13-
remarkRemoveMdLinks,
14-
remarkRemovePlainLanguageCode,
15-
remarkRemoveRepeatHeader,
16-
setLinkReferrer,
17-
} from "./src/utils/frontmatter.mjs";
18-
import { ANALYTICS, SIDEBAR, SITE } from "./src/utils/config.ts";
19-
import { starlightAsides } from "./node_modules/@astrojs/starlight/integrations/asides";
6+
import { SIDEBAR, SITE } from "./src/utils/config.ts";
207
import topLevelAwait from "vite-plugin-top-level-await";
218
import starlightUtils from "@lorenzo_lewis/starlight-utils";
229

23-
const whenExternalScripts = (items = []) =>
24-
ANALYTICS.vendors.googleAnalytics.id &&
25-
ANALYTICS.vendors.googleAnalytics.partytown
26-
? Array.isArray(items)
27-
? items.map((item) => item())
28-
: [items()]
29-
: [];
30-
3110
// https://astro.build/config
3211
export default defineConfig({
3312
site: process.env.DEPLOY_SITE || SITE.site,
3413
base: SITE.base,
14+
//设置处理后斜杠的策略
3515
trailingSlash: SITE.trailingSlash,
3616
image: {
3717
domain: ["img.alicdn"],
3818
},
39-
4019
integrations: [
4120
autoImportComponents(),
4221
starlight({
@@ -46,6 +25,11 @@ export default defineConfig({
4625
src: "./src/assets/logo.png",
4726
replacesTitle: true,
4827
},
28+
//自定义组件
29+
components: {
30+
//重写主题提供组件,实现默认深色主题
31+
ThemeProvider: "./src/components/ThemeProvider.astro",
32+
},
4933
disable404Route: true,
5034
social: {
5135
github: "https://github.com/Serverless-Devs/Serverless-Devs",
@@ -56,6 +40,7 @@ export default defineConfig({
5640
editLink: {
5741
baseUrl: SITE.websiteGithubUrl,
5842
},
43+
//多路侧边栏设置
5944
sidebar: SIDEBAR,
6045
plugins: [
6146
starlightUtils({
@@ -64,41 +49,14 @@ export default defineConfig({
6449
},
6550
}),
6651
],
67-
// locales,
68-
// customCss: ['./src/style/global.css','./src/style/fonts.css'],
6952
}),
7053
tailwind({ applyBaseStyles: false }),
7154
icon({
7255
tabler: ["book", "pencil"],
7356
"ant-design": ["github-filled"],
7457
basil: ["document-outline"],
7558
}),
76-
preact({ compat: true }),
77-
...whenExternalScripts(() =>
78-
partytown({
79-
config: { forward: ["dataLayer.push"] },
80-
}),
81-
),
8259
],
83-
markdown: {
84-
rehypePlugins: [
85-
// 在这里添加 rehype-external-links 插件配置
86-
[
87-
rehypeExternalLinks,
88-
{
89-
target: "_blank",
90-
},
91-
],
92-
],
93-
remarkPlugins: [
94-
remarkRemoveMdLinks,
95-
remarkRemovePlainLanguageCode,
96-
remarkRemoveRepeatHeader,
97-
addPrefixImageLink,
98-
starlightAsides,
99-
setLinkReferrer,
100-
],
101-
},
10260
vite: {
10361
build: {
10462
target: "chrome68",

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"@astrojs/starlight": "^0.24.0",
1717
"@astrojs/starlight-tailwind": "^2.0.1",
1818
"@astrojs/tailwind": "^5.1.0",
19+
"@b-design/color": "^1.0.7",
1920
"@docsearch/css": "^3.5.2",
2021
"@docsearch/js": "^3.5.2",
2122
"@fontsource-variable/bricolage-grotesque": "^5.0.6",

src/assets/CNCF.svg

Lines changed: 12 additions & 1 deletion
Loading

src/assets/fonts/Roboto-Black.ttf

164 KB
Binary file not shown.
170 KB
Binary file not shown.

src/assets/fonts/Roboto-Bold.ttf

163 KB
Binary file not shown.
167 KB
Binary file not shown.

src/assets/fonts/Roboto-Italic.ttf

167 KB
Binary file not shown.

src/assets/fonts/Roboto-Light.ttf

163 KB
Binary file not shown.

0 commit comments

Comments
 (0)