Skip to content

Commit ac92478

Browse files
committed
perf: 优化
1 parent ddf76a3 commit ac92478

62 files changed

Lines changed: 7517 additions & 11773 deletions

Some content is hidden

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

.github/workflows/deploy.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ jobs:
2222
uses: actions/checkout@v4
2323
- name: Install, build, and upload your site
2424
uses: withastro/action@v3
25-
# with:
26-
# path: . # The root location of your Astro project inside the repository. (optional)
27-
# node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 20. (optional)
28-
# package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
25+
with:
26+
package-manager: bun@latest
27+
node-version: 22
2928

3029
deploy:
3130
needs: build

astro.config.mjs

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sitemap from "@astrojs/sitemap";
22
import svelte from "@astrojs/svelte";
3-
import tailwind from "@astrojs/tailwind";
3+
import tailwindcss from "@tailwindcss/vite";
44
import swup from "@swup/astro";
55
import compressor from "astro-compressor";
66
import Compress from "astro-compress";
@@ -18,6 +18,7 @@ import { AdmonitionComponent } from "./src/plugins/rehype-component-admonition.m
1818
import { GithubCardComponent } from "./src/plugins/rehype-component-github-card.mjs";
1919
import { parseDirectiveNode } from "./src/plugins/remark-directive-rehype.js";
2020
import { remarkExcerpt } from "./src/plugins/remark-excerpt.js";
21+
import { remarkHasMath } from "./src/plugins/remark-has-math.js";
2122
import { remarkReadingTime } from "./src/plugins/remark-reading-time.mjs";
2223

2324
const compressBr = process.env.COMPRESS_BR === "true";
@@ -27,9 +28,6 @@ export default defineConfig({
2728
base: "personBlog",
2829
trailingSlash: "always",
2930
integrations: [
30-
tailwind({
31-
nesting: true,
32-
}),
3331
swup({
3432
theme: false,
3533
animationClass: "transition-swup-", // see https://swup.js.org/options/#animationselector
@@ -46,17 +44,32 @@ export default defineConfig({
4644
}),
4745
icon({
4846
include: {
49-
"preprocess: vitePreprocess(),": ["*"],
50-
"fa6-brands": ["*"],
51-
"fa6-regular": ["*"],
52-
"fa6-solid": ["*"],
47+
"material-symbols": [
48+
"calendar-today-outline-rounded",
49+
"edit-calendar-outline-rounded",
50+
"book-2-outline-rounded",
51+
"tag-rounded",
52+
"notes-rounded",
53+
"schedule-outline-rounded",
54+
"chevron-left-rounded",
55+
"chevron-right-rounded",
56+
"keyboard-arrow-up-rounded",
57+
"more-horiz",
58+
"home-outline-rounded",
59+
"palette-outline",
60+
"menu-rounded",
61+
"copyright-outline-rounded",
62+
],
63+
"fa6-brands": ["creative-commons", "github"],
64+
"fa6-regular": ["address-card"],
65+
"fa6-solid": ["arrow-up-right-from-square"],
5366
},
5467
}),
5568
svelte(),
5669
sitemap(),
5770
Compress({
58-
CSS: false,
59-
Image: false,
71+
CSS: true,
72+
Image: true,
6073
Action: {
6174
Passed: async () => true, // https://github.com/PlayForm/Compress/issues/376
6275
},
@@ -66,6 +79,7 @@ export default defineConfig({
6679
markdown: {
6780
remarkPlugins: [
6881
remarkMath,
82+
remarkHasMath,
6983
remarkReadingTime,
7084
remarkExcerpt,
7185
remarkGithubAdmonitionsToDirectives,
@@ -115,6 +129,7 @@ export default defineConfig({
115129
],
116130
},
117131
vite: {
132+
plugins: [tailwindcss()],
118133
build: {
119134
rollupOptions: {
120135
onwarn(warning, warn) {

bun.lock

Lines changed: 2481 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: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,67 +14,61 @@
1414
"new-post": "node scripts/new-post.js",
1515
"format": "biome format --write ./src",
1616
"lint": "biome check --apply ./src",
17-
"analyze": "node scripts/analyze-build.js",
18-
"preinstall": "npx only-allow pnpm"
17+
"analyze": "node scripts/analyze-build.js"
1918
},
2019
"dependencies": {
21-
"@astrojs/check": "0.9.6",
22-
"@astrojs/rss": "4.0.15",
23-
"@astrojs/sitemap": "3.7.0",
24-
"@astrojs/svelte": "7.2.5",
25-
"@astrojs/tailwind": "6.0.2",
26-
"@expressive-code/core": "0.41.6",
27-
"@expressive-code/plugin-collapsible-sections": "0.41.6",
28-
"@expressive-code/plugin-line-numbers": "0.41.6",
20+
"@astrojs/check": "0.9.8",
21+
"@astrojs/rss": "4.0.18",
22+
"@astrojs/sitemap": "3.7.2",
23+
"@astrojs/svelte": "8.0.4",
24+
"@expressive-code/core": "0.41.7",
25+
"@expressive-code/plugin-collapsible-sections": "0.41.7",
26+
"@expressive-code/plugin-line-numbers": "0.41.7",
2927
"@fontsource-variable/jetbrains-mono": "5.2.8",
30-
"@fontsource/roboto": "5.2.9",
28+
"@fontsource/roboto": "5.2.10",
3129
"@iconify-json/fa6-brands": "1.2.6",
3230
"@iconify-json/fa6-regular": "1.2.4",
3331
"@iconify-json/fa6-solid": "1.2.4",
34-
"@iconify-json/material-symbols": "1.2.53",
32+
"@iconify-json/material-symbols": "1.2.65",
3533
"@iconify/svelte": "5.2.1",
36-
"@swup/astro": "1.7.0",
37-
"@tailwindcss/typography": "0.5.19",
38-
"astro": "5.17.1",
39-
"astro-compress": "2.3.9",
40-
"astro-expressive-code": "0.41.6",
34+
"@swup/astro": "1.8.0",
35+
"@tailwindcss/typography": "^0.5.19",
36+
"@tailwindcss/vite": "4.2.2",
37+
"astro": "6.1.3",
38+
"astro-compress": "2.4.0",
39+
"astro-expressive-code": "0.41.7",
4140
"astro-icon": "1.1.5",
4241
"hastscript": "9.0.1",
43-
"katex": "0.16.28",
44-
"markdown-it": "14.1.0",
42+
"katex": "0.16.45",
43+
"markdown-it": "14.1.1",
4544
"mdast-util-to-string": "4.0.0",
4645
"overlayscrollbars": "2.14.0",
47-
"pagefind": "1.4.0",
46+
"pagefind": "1.5.0",
4847
"photoswipe": "5.4.4",
4948
"reading-time": "1.5.0",
5049
"rehype-autolink-headings": "7.1.0",
5150
"rehype-components": "0.3.0",
5251
"rehype-katex": "7.0.1",
5352
"rehype-slug": "6.0.0",
5453
"remark-directive": "4.0.0",
55-
"remark-directive-rehype": "0.4.2",
5654
"remark-github-admonitions-to-directives": "2.1.0",
5755
"remark-math": "6.0.0",
5856
"remark-sectionize": "2.1.0",
59-
"sanitize-html": "2.17.0",
57+
"sanitize-html": "2.17.2",
6058
"sharp": "0.34.5",
6159
"stylus": "0.64.0",
62-
"svelte": "5.49.1",
63-
"tailwindcss": "^3.4.17",
64-
"typescript": "5.9.3",
60+
"svelte": "5.55.1",
61+
"tailwindcss": "^4.2.2",
62+
"typescript": "6.0.2",
6563
"unist-util-visit": "5.1.0"
6664
},
6765
"devDependencies": {
68-
"@astrojs/ts-plugin": "1.10.6",
69-
"@biomejs/biome": "2.3.13",
70-
"@rollup/plugin-yaml": "4.1.2",
66+
"@astrojs/ts-plugin": "1.10.7",
67+
"@biomejs/biome": "2.4.10",
7168
"@types/hast": "3.0.4",
7269
"@types/markdown-it": "14.1.2",
7370
"@types/mdast": "4.0.4",
74-
"@types/sanitize-html": "2.16.0",
75-
"astro-compressor": "1.2.0",
76-
"postcss-import": "16.1.1",
77-
"postcss-nesting": "14.0.0"
78-
},
79-
"packageManager": "pnpm@9.14.4"
71+
"@types/sanitize-html": "2.16.1",
72+
"astro-compressor": "1.3.0"
73+
}
8074
}

0 commit comments

Comments
 (0)