Skip to content

Commit b548f7b

Browse files
committed
feat: academic-style redesign with Tailwind 4 and Source Serif 4
1 parent f3ea4cf commit b548f7b

21 files changed

Lines changed: 1033 additions & 555 deletions

‎astro.config.mjs‎

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,30 @@
22

33
import mdx from '@astrojs/mdx';
44
import sitemap from '@astrojs/sitemap';
5+
import tailwindcss from '@tailwindcss/vite';
56
import { defineConfig, fontProviders } from 'astro/config';
67

78
// https://astro.build/config
89
export default defineConfig({
910
// 仓库名匹配 <username>.github.io,因此不需要配置 base
1011
site: 'https://kingpython123.github.io',
12+
1113
integrations: [mdx(), sitemap()],
14+
1215
fonts: [
1316
{
14-
provider: fontProviders.local(),
15-
name: 'Atkinson',
16-
cssVariable: '--font-atkinson',
17-
fallbacks: ['sans-serif'],
18-
options: {
19-
variants: [
20-
{
21-
src: ['./src/assets/fonts/atkinson-regular.woff'],
22-
weight: 400,
23-
style: 'normal',
24-
display: 'swap',
25-
},
26-
{
27-
src: ['./src/assets/fonts/atkinson-bold.woff'],
28-
weight: 700,
29-
style: 'normal',
30-
display: 'swap',
31-
},
32-
],
33-
},
17+
// Astro 在构建时下载并自托管字体文件,运行时不请求 Google
18+
provider: fontProviders.google(),
19+
name: 'Source Serif 4',
20+
cssVariable: '--font-source-serif',
21+
// 只取正文和小标题两档字重,斜体用于强调和术语
22+
weights: [400, 600],
23+
styles: ['normal', 'italic'],
24+
fallbacks: ['Georgia', 'serif'],
3425
},
3526
],
27+
28+
vite: {
29+
plugins: [tailwindcss()],
30+
},
3631
});

0 commit comments

Comments
 (0)