Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(zh-cn): Update vercel.mdx #11099

Merged
merged 2 commits into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/content/docs/zh-cn/guides/integrations-guide/vercel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ReadMore from '~/components/ReadMore.astro'

此适配器允许 Astro 将你的[按需渲染的路由](/zh-cn/guides/on-demand-rendering/) 部署到[Vercel](https://www.vercel.com/)。

如果你使用 Astro 作为 静态 站点生成器,只有当你使用额外的 Vercel 服务时(例如 [Vercel 网络分析](https://vercel.com/docs/analytics),[Vercel 图像优化](https://vercel.com/docs/image-optimization)),你才需要这个适配器。否则,你不需要适配器来部署你的 `静态` 站点。
如果你使用 Astro 作为静态站点生成器,只有当你使用额外的 Vercel 服务时(例如 [Vercel 网络分析](https://vercel.com/docs/analytics),[Vercel 图像优化](https://vercel.com/docs/image-optimization)),你才需要这个适配器。否则,你不需要适配器来部署你的 `静态` 站点。

在我们的 [Vercel 部署指南](/zh-cn/guides/deploy/vercel/) 中学习和部署你的 Astro 站点。

Expand Down Expand Up @@ -266,18 +266,22 @@ export default defineConfig({

要实现 Vercel 的[草稿模式](https://vercel.com/docs/build-output-api/v3/features#draft-mode)或[按需增量式静态再生 (ISR)](https://vercel.com/docs/build-output-api/v3/features#on-demand-incremental-static-regeneration-isr),你可以创建一个绕过令牌,并将其连同任何要从缓存中排除的路由一起提供给 `isr` 配置:

```js title="astro.config.mjs" {7-12}
```js title="astro.config.mjs" {7-16}
import { defineConfig } from 'astro/config';
import vercel from '@astrojs/vercel';

export default defineConfig({
output: "server",
adapter: vercel({
isr: {
// 你创建的一个秘密随机字符串
// 你创建的一个私密随机字符串
bypassToken: "005556d774a8",
// 总是提供最新内容的路径。
exclude: [ "/api/invalidate", "/posts/[...slug]" ]
exclude: [
'/preview',
'/auth/[page]',
/^\/api\/.+/ // 自 @astrojs/vercel @v8.1.0 以来支持的正则表达式
]
}
})
})
Expand Down
Loading