Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into server-islands
Browse files Browse the repository at this point in the history
dreyfus92 authored Dec 18, 2024
2 parents 756885d + f06fc69 commit e23d988
Showing 8 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/ko/guides/on-demand-rendering.mdx
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ Astro 프로젝트 코드는 웹에서 표시되기 위해 HTML로 **렌더링**

페이지를 필요에 따라 렌더링하려면 **어댑터**를 추가해야 합니다. 각 어댑터를 통해 Astro는 특정 **런타임**에서 프로젝트를 실행하는 스크립트를 출력할 수 있습니다: 런타임은 페이지가 요청될 때 서버에서 페이지를 생성하는 코드를 실행하는 환경입니다(예: Netlify, Cloudflare).

사이트가 완전히 정적이고 페이지를 필요에 따라 렌더링하지 않더라도 어댑터를 추가하고 싶을 수 있습니다. 예를 들어, [Netlify 어댑터](/ko/guides/integrations-guide/netlify/)는 Netlify의 이미지 CDN을 활성화하고, [Vercel 어댑터](/ko/guides/integrations-guide/vercel/)웹 애널리틱스와 같은 서비스를 활성화합니다.
사이트가 완전히 정적이고 페이지를 필요에 따라 렌더링하지 않더라도 어댑터를 추가하고 싶을 수 있습니다. 예를 들어, [Netlify 어댑터](/ko/guides/integrations-guide/netlify/)는 Netlify의 이미지 CDN을 활성화하고, [서버 아일랜드](/ko/guides/server-islands/)컴포넌트에서 `server:defer`를 사용하기 위해 어댑터가 설치되어 있어야 합니다.

<IntegrationsNav category="adapter"/>

8 changes: 4 additions & 4 deletions src/content/docs/ko/guides/routing.mdx
Original file line number Diff line number Diff line change
@@ -552,11 +552,11 @@ const params = Astro.params;

## 페이지 제외

페이지나 디렉터리 이름 앞에 밑줄 (`_`)을 붙여서 빌드되지 않도록 제외할 수 있습니다. `_` 접두사가 붙은 파일은 라우터에서 인식되지 않으며 `dist/` 디렉터리에 배치되지 않습니다.
`src/pages`에 위치한 페이지나 디렉터리 이름 앞에 밑줄 (`_`)을 붙여서 빌드되지 않도록 제외할 수 있습니다. `_` 접두사가 붙은 파일은 라우터에서 인식되지 않으며 `dist/` 디렉터리에 배치되지 않습니다.

이를 사용하여 페이지를 일시적으로 비활성화하고 테스트, 유틸리티 및 컴포넌트를 관련 페이지와 동일한 폴더에 넣을 수도 있습니다.

이 예시에서는 `src/pages/index.astro``src/pages/posts/post1.md` 파일만 페이지 경로 및 HTML 파일로 빌드됩니다.
이 예시에서는 `src/pages/index.astro``src/pages/projects/project1.md` 파일만 페이지 경로 및 HTML 파일로 빌드됩니다.

<FileTree>
- src/pages/
@@ -565,8 +565,8 @@ const params = Astro.params;
- page2.md
- _hidden-page.astro
- **index.astro**
- posts/
- projects/
- _SomeComponent.astro
- _utils.js
- **post1.md**
- **project1.md**
</FileTree>
2 changes: 1 addition & 1 deletion src/content/docs/zh-cn/guides/astro-db.mdx
Original file line number Diff line number Diff line change
@@ -362,7 +362,7 @@ const comments = await db.select().from(Comment);

### 插入

要接受用户输入,如处理表单请求并将数据插入到你的远程托管数据库,需要为你的 Astro 项目配置 [按需渲染](/zh-cn/guides/on-demand-rendering/) 并为你的部署环境 [添加一个 SSR 适配器](/zh-cn/guides/on-demand-rendering/#add-an-adapter)
要接受用户输入,如处理表单请求并将数据插入到你的远程托管数据库,需要为你的 Astro 项目配置 [按需渲染](/zh-cn/guides/on-demand-rendering/) 并为你的部署环境 [添加一个适配器](/zh-cn/guides/on-demand-rendering/#add-an-adapter)

这个例子基于解析后表单的 POST 请求向 `Comment` 表插入一行:

2 changes: 1 addition & 1 deletion src/content/docs/zh-cn/guides/styling.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 样式 & CSS
title: 样式 CSS
description: >-
学习如何在 Astro 中使用作用域样式、外部 CSS 以及类似 Sass 和 PostCSS 的工具来为组件添加样式。
---
6 changes: 3 additions & 3 deletions src/content/docs/zh-cn/guides/testing.mdx
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ Playwright 是一个针对现代网络应用的端到端测试框架。使用 Ja
<html lang="en">
<head>
<title>Astro is awesome!</title>
<meta name="description" content="Pull content from anywhere and serve it fast with Astro's next-gen island architecture." />
<meta name="description" content="Pull content from anywhere and serve it fast with Astro's next-gen islands architecture." />
</head>
<body></body>
</html>
@@ -244,7 +244,7 @@ export default defineConfig({
<html lang="en">
<head>
<title>Astro is awesome!</title>
<meta name="description" content="Pull content from anywhere and serve it fast with Astro's next-gen island architecture." />
<meta name="description" content="Pull content from anywhere and serve it fast with Astro's next-gen islands architecture." />
</head>
<body>
<h1>Hello world from Astro</h1>
@@ -355,7 +355,7 @@ Nightwatch.js 是一个测试自动化框架,它配备了一套强大的工具
<html lang="en">
<head>
<title>Astro is awesome!</title>
<meta name="description" content="Pull content from anywhere and serve it fast with Astro's next-gen island architecture." />
<meta name="description" content="Pull content from anywhere and serve it fast with Astro's next-gen islands architecture." />
</head>
<body></body>
</html>
2 changes: 2 additions & 0 deletions src/content/docs/zh-cn/reference/modules/astro-assets.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: 资源 API 参考
sidebar:
label: 'astro:assets'
i18nReady: true
tableOfContents:
minHeadingLevel: 2
2 changes: 2 additions & 0 deletions src/content/docs/zh-cn/reference/modules/astro-i18n.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: 国际化 API 参考
sidebar:
label: 'astro:i18n'
i18nReady: true
tableOfContents:
minHeadingLevel: 2
6 changes: 4 additions & 2 deletions src/content/docs/zh-cn/reference/modules/astro-middleware.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
title: 中间件 API 参考
sidebar:
label: 'astro:middleware'
i18nReady: true
tableOfContents:
minHeadingLevel: 2
@@ -64,7 +66,7 @@ export const onRequest = sequence(validation, auth, greeting);
<Since v="2.8.0" />
</p>

一个底层 API,用于创建一个 [`APIContext`](/zh-cn/reference/api-reference/#端点上下文) 以传递给 Astro 中间件的 `onRequest()` 函数。
一个底层 API,用于创建一个 [`APIContext`](/zh-cn/reference/api-reference/) 以传递给 Astro 中间件的 `onRequest()` 函数。

此函数可以由集成/适配器用于执行 Astro 中间件。

@@ -108,7 +110,7 @@ export function onRequest (context, next) {

`onRequest()` 的第一个参数是一个上下文对象。它反映了许多 `Astro` 全局属性。

<ReadMore>有关更多信息,请参阅 [端点上下文](/zh-cn/reference/api-reference/#端点上下文)。</ReadMore>
<ReadMore>有关更多信息,请参阅 [端点上下文](/zh-cn/reference/api-reference/)。</ReadMore>

#### `next()`

0 comments on commit e23d988

Please sign in to comment.