Skip to content

Commit d10896b

Browse files
committed
feat: 添加@astrojs/node依赖并配置独立模式
在package.json中添加@astrojs/node依赖,并在astro.config.mjs中配置node适配器为独立模式。同时新增blog/[slug].astro页面和robots.txt.ts文件,用于处理动态路由和生成robots.txt文件。
1 parent d6e85f1 commit d10896b

5 files changed

Lines changed: 169 additions & 1 deletion

File tree

blog-web/astro.config.mjs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ import solidJs from "@astrojs/solid-js";
77

88
import sitemap from "@astrojs/sitemap";
99

10+
import node from "@astrojs/node";
11+
1012
// https://astro.build/config
1113
export default defineConfig({
1214
vite: {
1315
plugins: [tailwindcss()],
1416
},
17+
1518
site: "https://blog.exquisitecore.xzy",
1619
integrations: [solidJs(), sitemap()],
17-
});
20+
21+
adapter: node({
22+
mode: "standalone",
23+
}),
24+
});

blog-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"astro": "astro"
1010
},
1111
"dependencies": {
12+
"@astrojs/node": "^9.2.1",
1213
"@astrojs/sitemap": "^3.4.0",
1314
"@astrojs/solid-js": "^5.0.10",
1415
"@tailwindcss/vite": "^4.1.6",

blog-web/pnpm-lock.yaml

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

0 commit comments

Comments
 (0)