From 5594b00b68eaf01d35a33f6b8175b87d7a2fe467 Mon Sep 17 00:00:00 2001 From: Junseong Park <39112954+jsparkdev@users.noreply.github.com> Date: Tue, 17 Mar 2026 13:40:21 +0900 Subject: [PATCH 1/6] i18n(ko-KR): update `configuration-reference.mdx` --- .../ko/reference/configuration-reference.mdx | 752 ++++++++++++++++-- 1 file changed, 680 insertions(+), 72 deletions(-) diff --git a/src/content/docs/ko/reference/configuration-reference.mdx b/src/content/docs/ko/reference/configuration-reference.mdx index f6287b63c8f56..c6ef96392ffe5 100644 --- a/src/content/docs/ko/reference/configuration-reference.mdx +++ b/src/content/docs/ko/reference/configuration-reference.mdx @@ -373,6 +373,60 @@ Astro 컴포넌트의 요소 선택기가 전역 스타일 기본값 (예: 전 ``where'`를 사용하면 구체성을 더 잘 제어할 수 있지만, 적용되는 선택기를 제어하려면 더 높은 구체성 선택기, 레이어 및 기타 도구를 사용해야 합니다. `'attribute'`를 사용하는 것은 요소의 `class` 속성을 조작하고 자신의 스타일 지정 로직과 Astro의 스타일 적용 사이의 충돌을 피해야 할 때 유용합니다. +### prerenderConflictBehavior + +

+ +**타입:** `'error' | 'warn' | 'ignore'`
+**기본값:** `'warn'`
+ +

+ +두 개의 라우트가 동일한 사전 렌더링된 URL을 생성할 때의 기본 동작을 결정합니다. + +- `error`: 빌드를 실패시키고 오류를 표시하여 충돌을 해결하도록 합니다. +- `warn` (기본값): 충돌이 발생하면 경고를 기록하지만, 우선순위가 가장 높은 라우트를 사용하여 빌드를 진행합니다. +- `ignore`: 충돌이 발생해도 아무 메시지 없이 우선순위가 가장 높은 라우트를 사용하여 빌드를 진행합니다. + +```js +{ + prerenderConflictBehavior: 'error' +} +``` + +### vite + +

+ +**타입:** `ViteUserConfig` +

+ +Vite에 추가 설정 옵션을 전달합니다. Astro가 필요한 일부 고급 설정을 지원하지 않을 때 유용합니다. + +전체 `vite` 설정 객체 문서는 [vite.dev](https://ko.vite.dev/config/)에서 확인할 수 있습니다. + +#### 예시 + +```js +{ + vite: { + ssr: { + // 예: 필요한 경우, 손상된 패키지가 SSR 처리를 건너뛰도록 강제합니다. + external: ['broken-npm-package'], + } + } +} +``` + +```js +{ + vite: { + // 예: Astro 프로젝트에 직접 맞춤형 vite 플러그인 추가 + plugins: [myPlugin()], + } +} +``` + ### security

@@ -428,6 +482,9 @@ SSR 사용 시 들어오는 요청에 대해 허용되는 호스트 패턴 목 각 패턴은 `protocol`, `hostname`, `port`를 지정할 수 있습니다. 제공된 옵션에 대해 유효성 검사를 수행합니다. 패턴은 유연한 호스트명 일치를 위해 와일드카드를 지원합니다. +- `*.example.com` - 정확히 한 단계의 서브도메인과 일치합니다 (예: `sub.example.com`은 일치하지만 `deep.sub.example.com`은 일치하지 않음) +- `**.example.com` - 모든 깊이의 서브도메인과 일치합니다 (예: `sub.example.com`과 `deep.sub.example.com` 모두 일치) + ```js { security: { @@ -447,40 +504,359 @@ SSR 사용 시 들어오는 요청에 대해 허용되는 호스트 패턴 목 } ``` +일부 특정 상황(예: 동적 도메인을 사용하는 신뢰할 수 있는 리버스 프록시 뒤에 있는 애플리케이션)에서는 모든 도메인을 허용해야 할 수 있습니다. 이 경우 빈 객체를 사용하세요. + +```js +{ + security: { + // 모든 도메인 허용 - 필요한 경우에만 사용하세요. + allowedDomains: [{}] + } +} +``` + 이 설정이 구성되지 않으면, `X-Forwarded-Host` 헤더는 신뢰되지 않으며 무시됩니다. -### vite +#### security.serverIslandBodySizeLimit

-**타입:** `ViteUserConfig` +**타입:** `number`
+**기본값:** `1048576` (1 MB)
+ +

+ +아일랜드 컴포넌트로 전달되는 암호화된 props와 슬롯 HTML이 포함된 서버 아일랜드 요청 본문의 허용 최대 크기(바이트)를 설정합니다. +기본적으로 서버 아일랜드 요청 본문은 남용을 방지하기 위해 1MB(1048576바이트)로 제한됩니다. +서버 아일랜드가 더 큰 페이로드를 받아야 하는 경우 이 제한을 늘릴 수 있습니다. + +```js +// astro.config.mjs +export default defineConfig({ + security: { + serverIslandBodySizeLimit: 10 * 1024 * 1024 // 10 MB + } +}) +``` + +#### security.csp + +

+ +**타입:** `boolean | object`
+**기본값:** `false`
+

-추가 구성 옵션을 Vite에 전달합니다. Astro가 필요할 수 있는 일부 고급 구성을 지원하지 않을 때 유용합니다. +[콘텐츠 보안 정책(CSP)](https://developer.mozilla.org/ko/docs/Web/HTTP/CSP) 지원을 활성화하여 문서가 로드할 수 있는 리소스를 제어함으로써 특정 유형의 보안 위협을 최소화합니다. 이는 [크로스 사이트 스크립팅(XSS)](https://developer.mozilla.org/ko/docs/Glossary/Cross-site_scripting) 공격에 대한 추가적인 보호를 제공합니다. -[vite.dev](https://ko.vite.dev/config/)에서 전체 `vite` 구성 객체 문서를 확인하세요. +이 기능을 활성화하면 Astro의 처리 및 번들링된 스크립트와 스타일에 대한 기본 보안이 강화되며, 이러한 요소와 추가 콘텐츠 유형을 추가로 구성할 수 있습니다. -#### 예 +이 기능에는 몇 가지 제한 사항이 있습니다: +- 외부 스크립트 및 외부 스타일은 기본적으로 지원되지 않지만, [자신만의 해시를 제공](#securitycspscriptdirectivehashes)할 수 있습니다. +- ``를 사용하는 [Astro의 뷰 전환](/ko/guides/view-transitions/)은 지원되지 않지만, Astro의 네이티브 뷰 전환 및 내비게이션 API 개선 사항을 사용하지 않는 경우 [브라우저 네이티브 뷰 전환 API로 마이그레이션](https://events-3bg.pages.dev/jotter/astro-view-transitions/)하는 것을 고려할 수 있습니다. +- Shiki는 현재 지원되지 않습니다. Shiki 함수는 인라인 스타일을 사용하므로 Astro CSP 구현과 함께 작동할 수 없습니다. 프로젝트에 CSP와 구문 강조가 모두 필요한 경우 [`` 사용](/ko/guides/syntax-highlighting/#prism-)을 고려하세요. +- `unsafe-inline` 지시어는 Astro의 CSP 구현과 호환되지 않습니다. 기본적으로 Astro는 번들링된 모든 스크립트(예: 클라이언트 아일랜드)에 대한 해시를 생성하며, 모든 최신 브라우저는 해시 또는 nonce가 있는 지시어에 `unsafe-inline`이 포함될 경우 이를 자동으로 거부합니다. -```js -{ - vite: { - ssr: { - // 예: 필요한 경우, 손상된 패키지가 SSR 처리를 건너뛰도록 강제합니다. - external: ['broken-npm-package'], +:::note +Vite 개발 서버의 특성상 이 기능은 `dev` 모드에서 작업하는 동안 지원되지 않습니다. 대신, `build` 및 `preview`를 사용하여 Astro 프로젝트에서 이 기능을 테스트할 수 있습니다. +::: + +활성화되면 Astro는 각 페이지의 `` 요소 내부에 `` 요소를 추가합니다. +이 요소는 `http-equiv="content-security-policy"` 속성을 가지며, `content` 속성은 페이지에서 사용되는 스크립트 및 스타일에 따라 `script-src` 및 `style-src` [지시어](#securitycspdirectives)에 대한 값을 제공합니다. + +```html + + + + +``` + +추가 옵션이 포함된 구성 객체로 이 기능을 활성화하여 `` 요소를 맞춤설정할 수 있습니다. + +##### security.csp.algorithm + +

+ +**타입:** `"SHA-256" | "SHA-384" | "SHA-512"`
+**기본값:** `'SHA-256'`
+ +

+ +Astro가 스타일과 스크립트의 해시를 생성할 때 사용할 [해시 함수](https://developer.mozilla.org/ko/docs/Glossary/Hash_function)입니다. + +```js title="astro.config.mjs" +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + security: { + csp: { + algorithm: 'SHA-512' } } -} +}); ``` -```js -{ - vite: { - // 예: Astro 프로젝트에 직접 맞춤형 vite 플러그인 추가 - plugins: [myPlugin()], +##### security.csp.directives + +

+ +**타입:** `Array`
+**기본값:** `[]`
+ +

+ +특정 콘텐츠 타입에 대한 유효한 소스를 정의하는 [CSP 지시어](https://content-security-policy.com/#directive) 목록입니다 (기본적으로 포함된 `script-src` 및 `style-src` 외에). 이 지시어는 모든 페이지에 추가됩니다. + +```js title="astro.config.mjs" +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + security: { + csp: { + directives: [ + "default-src 'self'", + "img-src 'self' https://images.cdn.example.com" + ] + } } -} +}); +``` +빌드 후, `` 요소는 Astro의 기본 지시어와 함께 여러분의 지시어를 `content` 값에 추가할 것입니다. + +```html + +``` + +##### security.csp.styleDirective + +

+ +**타입:** `CspStyleDirective`
+**기본값:** `undefined`
+ +

+ +`style-src` 지시어의 기본 소스를 [`resources`](#securitycspstyledirectiveresources) 속성으로 재정의하거나, 추가 [해시](#securitycspstyledirectivehashes)를 렌더링할 수 있도록 하는 구성 객체입니다. + +###### security.csp.styleDirective.hashes + +

+ +**타입:** `Array`
+**기본값:** `[]`
+ +

+ +렌더링할 추가 해시 목록입니다. + +`sha384-`, `sha512-`, `sha256-`으로 시작하는 해시를 제공해야 합니다. 다른 값은 유효성 검사 오류를 발생시킵니다. 이 해시들은 모든 페이지에 추가됩니다. + +```js title="astro.config.mjs" +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + security: { + csp: { + styleDirective: { + hashes: [ + "sha384-styleHash", + "sha512-styleHash", + "sha256-styleHash" + ] + } + } + } +}); +``` + +빌드 후, `` 요소는 `style-src` 지시어에 여러분의 추가 해시를 포함하게 됩니다. + +```html + +``` + +###### security.csp.styleDirective.resources + +

+ +**타입:** `Array`
+**기본값:** `[]`
+ +

+ +Astro의 기본 소스를 덮어쓰기 위한 `style-src` 지시어의 유효한 소스 목록입니다. 이 목록에는 기본적으로 `'self'`가 포함되지 않으므로, 유지하려면 이 목록에 포함해야 합니다. 이 리소스는 모든 페이지에 추가됩니다. + +```js title="astro.config.mjs" +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + security: { + csp: { + styleDirective: { + resources: [ + "'self'", + "https://styles.cdn.example.com" + ] + } + } + } +}); +``` + +빌드 후, `` 요소는 대신 여러분의 소스를 `style-src` 지시어에 적용할 것입니다. + +```html + + + +``` + +리소스가 여러 번 삽입되거나 여러 소스(예: `csp` 구성에 정의된 것과 [CSP 런타임 API](/ko/reference/api-reference/#csp)를 사용하여 추가된 것)에서 제공되는 경우, Astro는 모든 리소스를 병합하고 중복을 제거하여 `` 요소를 생성합니다. + +##### security.csp.scriptDirective + +

+ +**타입:** `CspScriptDirective`
+**기본값:** `undefined`
+ +

+ +`script-src` 지시어의 기본 소스를 [`resources`](#securitycspscriptdirectiveresources) 속성으로 재정의하거나, 추가 [해시](#securitycspscriptdirectivehashes)를 렌더링할 수 있도록 하는 구성 객체입니다. + +###### security.csp.scriptDirective.hashes + +

+ +**타입:** `Array`
+**기본값:** `[]`
+ +

+ +렌더링할 추가 해시 목록입니다. + +`sha384-`, `sha512-`, `sha256-`으로 시작하는 해시를 제공해야 합니다. 다른 값은 유효성 검사 오류를 발생시킵니다. 이 해시는 모든 페이지에 추가됩니다. + +```js title="astro.config.mjs" +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + security: { + csp: { + scriptDirective: { + hashes: [ + "sha384-scriptHash", + "sha512-scriptHash", + "sha256-scriptHash" + ] + } + } + } +}); +``` + +빌드 후, `` 요소는 `script-src` 지시어에 여러분의 추가 해시를 포함하게 됩니다. + +```html + +``` + +###### security.csp.scriptDirective.resources + +

+ +**타입:** `Array`
+**기본값:** `[]`
+ +

+ +`script-src` 지시어에 대한 유효한 소스 목록으로, Astro의 기본 소스를 재정의합니다. 기본적으로 `'self'`는 포함되지 않으므로, 이를 유지하려면 이 목록에 포함해야 합니다. 이러한 리소스는 모든 페이지에 추가됩니다. + +```js title="astro.config.mjs" +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + security: { + csp: { + scriptDirective: { + resources: [ + "'self'", "https://cdn.example.com" + ] + } + } + } +}); +``` + +빌드 후, `` 요소는 대신 여러분의 소스를 `script-src` 지시어에 적용할 것입니다. + +```html + + + +``` + +리소스가 여러 번 삽입되거나 여러 소스(예: `csp` 구성에 정의된 것과 [CSP 런타임 API](/ko/reference/api-reference/#csp)를 사용하여 추가된 것)에서 제공되는 경우, Astro는 모든 리소스를 병합하고 중복을 제거하여 `` 요소를 생성합니다. + +###### security.csp.scriptDirective.strictDynamic + +

+ +**타입:** `boolean`
+**기본값:** `false`
+ +

+ +스크립트의 동적 주입을 지원하기 위해 [`strict-dynamic` 키워드](https://developer.mozilla.org/ko/docs/Web/HTTP/Headers/Content-Security-Policy/script-src#strict-dynamic)를 활성화합니다. + +```js title="astro.config.mjs" +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + security: { + csp: { + scriptDirective: { + strictDynamic: true + } + } + } +}); ``` ## 빌드 옵션 @@ -868,22 +1244,26 @@ Astro 프로젝트의 세션 스토리지를 구성합니다. 이는 세션 데

-**타입:** `string | undefined`
+**타입:** `SessionDriverConfig | undefined`

-세션 스토리지를 위해 사용할 Unstorage 드라이버입니다. [Node](/ko/guides/integrations-guide/node/#세션), [Cloudflare](/ko/guides/integrations-guide/cloudflare/#세션), [Netlify](/ko/guides/integrations-guide/netlify/#세션) 어댑터는 자동으로 기본 드라이버를 구성하지만, 기본 드라이버를 제공하지 않는 어댑터를 선호하거나 사용하는 경우 사용자 정의 드라이버를 지정할 수 있습니다. +세션 스토리지를 위해 사용할 드라이버입니다. [Node](/ko/guides/integrations-guide/node/#세션), [Cloudflare](/ko/guides/integrations-guide/cloudflare/#세션), [Netlify](/ko/guides/integrations-guide/netlify/#세션) 어댑터는 자동으로 기본 드라이버를 구성하지만, 기본 드라이버를 제공하지 않는 어댑터를 선호하거나 사용하는 경우 사용자 정의 드라이버를 지정할 수 있습니다. -이 값은 [Unstorage 드라이버 문서](https://unstorage.unjs.io/drivers)에 있는 "드라이버 이름"입니다. +```js title="astro.config.mjs" ins={7-9} ins=" sessionDrivers " +import { defineConfig, sessionDrivers } from 'astro/config' +import vercel from '@astrojs/vercel' -```js title="astro.config.mjs" ins={4} -{ - adapter: vercel(), +export default defineConfig({ + adapter: vercel() session: { - driver: "redis", - }, -} + driver: sessionDrivers.redis({ + url: process.env.REDIS_URL + }), + } +}) ``` + :::note 일부 드라이버는 추가 패키지 설치가 필요할 수 있습니다. 또한 일부 드라이버는 환경 변수나 자격 증명 설정을 요구할 수도 있습니다. 자세한 내용은 [Unstorage 문서](https://unstorage.unjs.io/drivers)를 참조하세요. ::: @@ -897,6 +1277,10 @@ Astro 프로젝트의 세션 스토리지를 구성합니다. 이는 세션 데

+:::caution[사용되지 않음] +이 옵션은 더 이상 사용되지 않으며 향후 주요 버전에서 삭제될 예정입니다. 대신 드라이버 함수에 옵션을 전달하세요. +::: + 세션 스토리지를 위해 사용할 드라이버별 옵션입니다. 옵션은 사용 중인 드라이버에 따라 다릅니다. 각 드라이버에서 사용할 수 있는 옵션에 대한 자세한 내용은 [Unstorage 문서](https://unstorage.unjs.io/drivers)를 참조하세요. ```js title="astro.config.mjs" ins={4-6} @@ -955,7 +1339,7 @@ Astro 프로젝트의 세션 스토리지를 구성합니다. 이는 세션 데 세션 값에 대한 선택적 기본 만료 시간(초)입니다. -기본적으로 세션 값은 삭제되거나 세션이 파괴될 때까지 유지되며, 특정 시간이 경과해도 자동으로 만료되지 않습니다. 세션 값에 대한 기본 만료 기간을 추가하려면 `session.ttl`을 설정하세요. [`session.set()`](/ko/reference/api-reference/#set)에 `ttl` 옵션을 전달하면 해당 개별 항목에 대한 전역 기본값을 덮어씁니다. +기본적으로 세션 값은 삭제되거나 세션이 파괴될 때까지 유지되며, 특정 시간이 경과해도 자동으로 만료되지 않습니다. 세션 값에 대한 기본 만료 기간을 추가하려면 `session.ttl`을 설정하세요. [`session.set()`](/ko/reference/api-reference/#sessionset)에 `ttl` 옵션을 전달하면 해당 개별 항목에 대한 전역 기본값을 덮어씁니다. ```js title="astro.config.mjs" ins={3-4} { @@ -1633,14 +2017,14 @@ export default defineConfig({

**타입:** `boolean`
-**기본값:** `true`
+**기본값:** `false`

`prefixDefaultLocale: true`가 설정된 경우 `src/pages/index.astro`에 의해 생성된 홈 URL (`/`)이 `/[defaultLocale]`로 리디렉션되는지 여부를 구성합니다. -사이트 루트에서 자동 리디렉션을 비활성화하려면 `redirectToDefaultLocale: false`를 설정하세요. +사이트 루트에서 자동 리디렉션을 활성화하려면 `redirectToDefaultLocale: true`를 설정하세요. ```js // astro.config.mjs @@ -1650,7 +2034,7 @@ export default defineConfig({ locales: ['en', 'fr'], routing: { prefixDefaultLocale: true, - redirectToDefaultLocale: false, + redirectToDefaultLocale: true, }, }, }); @@ -1753,7 +2137,9 @@ Astro의 [환경 변수](/ko/guides/environment-variables/)에 대한 자세한

-`envField`를 사용하여 환경 변수의 데이터 타입과 속성을 정의하는 객체입니다: `context`(클라이언트 또는 서버), `access`(공개 또는 비밀), 사용할 `default` 값, 그리고 이 환경 변수가 `optional`인지 여부(기본값은 `false`). +Zod 유효성 검사를 통해 강제되고 TypeScript 지원(예: 자동 완성, 타입 안정성)이 제공되는 환경 변수를 정의합니다. 각 키는 변수 이름에 해당하며, 값은 [`envField`로 정의된](/ko/reference/modules/astro-config/#envfield) 데이터 타입 및 유효성 검사에 해당합니다. + +문자열, 숫자, 열거형, 불리언의 네 가지 데이터 타입을 지원합니다. 각 타입에는 `context` (client 또는 server), `access` 수준 (public 또는 secret)이 필요하며, `default` 값이나 변수의 `optional` 여부(기본값은 `false`)와 같은 추가 유효성 검사 옵션을 설정할 수 있습니다. ```js // astro.config.mjs @@ -1770,46 +2156,6 @@ export default defineConfig({ }) ``` -`envField`는 문자열, 숫자, 열거형, 불리언의 네 가지 데이터 타입을 지원합니다. `context`와 `access`는 모든 데이터 타입에 필요한 속성입니다. 다음은 각 데이터 타입에 사용할 수 있는 전체 속성 목록입니다: - -```js -import { envField } from "astro/config" - -envField.string({ - // context & access - optional: true, - default: "foo", - max: 20, - min: 1, - length: 13, - url: true, - includes: "oo", - startsWith: "f", - endsWith: "o", -}) -envField.number({ - // context & access - optional: true, - default: 15, - gt: 2, - min: 1, - lt: 3, - max: 4, - int: true, -}) -envField.boolean({ - // context & access - optional: true, - default: true, -}) -envField.enum({ - // context & access - values: ['foo', 'bar', 'baz'], // 필수 - optional: true, - default: 'baz', -}) -``` - ### env.validateSecrets

@@ -1836,3 +2182,265 @@ export default defineConfig({ } }) ``` + +## fonts + +

+ +**타입:** `Array`
+**기본값:** `[]`
+ +

+ +폰트를 구성하고 폰트별로 일부 맞춤 옵션을 지정할 수 있습니다. + +[Astro에서 커스텀 폰트를 사용하는 방법](/ko/guides/fonts/)에 대한 자세한 내용은 가이드를 참조하세요. + +### font.provider + +

+ +**타입:** `FontProvider`
+ +

+ +폰트 파일의 소스입니다. [내장 제공자](/ko/reference/font-provider-reference/#built-in-providers)를 사용하거나 나만의 [커스텀 제공자](/ko/reference/font-provider-reference/#building-a-font-provider)를 작성할 수 있습니다. + +```js +import { defineConfig, fontProviders } from "astro/config"; + +export default defineConfig({ + fonts: [{ + provider: fontProviders.google(), + name: "Roboto", + cssVariable: "--font-roboto" + }] +}); +``` + +### font.name + +

+ +**타입:** `string`
+ +

+ +폰트 제공자가 식별하는 폰트 패밀리 이름입니다. + +```js +name: "Roboto" +``` + +### font.cssVariable + +

+ +**타입:** `string`
+ +

+ +CSS 변수 형태(즉, `--`로 시작)로 선택한 유효한 [ident](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/ident)입니다. + +```js +cssVariable: "--font-roboto" +``` + +### font.fallbacks + +

+ +**타입:** `Array`
+**기본값:** `["sans-serif"]`
+ +

+ +선택한 폰트를 사용할 수 없거나 로딩 중일 때 사용할 폰트 배열입니다. 대체 폰트는 나열된 순서대로 선택됩니다. 사용 가능한 첫 번째 폰트가 사용됩니다. + +```js +fallbacks: ["CustomFont", "serif"] +``` + +대체 폰트를 완전히 비활성화하려면 빈 배열을 구성하세요. + +```js +fallbacks: [] +``` + +폰트의 의도된 모양과 일치하는 [일반 패밀리 이름](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-family#generic-name)을 하나 이상 지정하세요. 그러면 Astro는 폰트 메트릭을 사용하여 [최적화된 대체 폰트](https://developer.chrome.com/blog/font-fallbacks) 생성을 시도합니다. 이 최적화를 비활성화하려면 `optimizedFallbacks`를 false로 설정하세요. + +### font.optimizedFallbacks + +

+ +**타입:** `boolean`
+**기본값:** `true`
+ +

+ +대체 폰트를 생성할 때 Astro의 기본 최적화를 활성화할지 여부입니다. [`fallbacks`](#fontfallbacks)가 생성되는 방식을 완전히 제어하기 위해 이 기본 최적화를 비활성화할 수 있습니다. + +```js +optimizedFallbacks: false +``` + +### font.weights + +

+ +**타입:** `Array<(number|string)>`
+**기본값:** `[400]`
+ +

+ +[폰트 두께](https://developer.mozilla.org/ko/docs/Web/CSS/font-weight) 배열입니다. 구성에 값을 지정하지 않으면 불필요한 다운로드를 방지하기 위해 기본적으로 두께 `400`만 포함됩니다. 다른 폰트 두께에 액세스하려면 이 속성을 포함해야 합니다. + +```js +weights: [200, "400", "bold"] +``` + +관련 폰트가 [가변 폰트](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Fonts/Variable_fonts)인 경우 두께 범위를 지정할 수 있습니다. + +```js +weights: ["100 900"] +``` + +### font.styles + +

+ +**타입:** `Array<("normal"|"italic"|"oblique")>`
+**기본값:** `["normal", "italic"]`
+ +

+ +[폰트 스타일](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/font-style) 배열입니다. + +```js +styles: ["normal", "oblique"] +``` + +### font.subsets + +

+ +**타입:** `Array`
+**기본값:** `["latin"]`
+ +

+ +미리 로드할 [폰트 서브셋](https://knaap.dev/posts/font-subsetting/) 목록을 정의합니다. + +```js +subsets: ["latin"] +``` + +### font.formats + +

+ +**타입:** `Array<("woff2"|"woff"|"otf"|"ttf"|"eot")>`
+**기본값:** `["woff2"]`
+ +

+ +[폰트 형식](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@font-face/src) 배열입니다. + +```js +formats: ["woff2", "woff"] +``` + +### font.options + +

+ +**타입:** `Record`
+ +

+ +제공자별 옵션을 전달하는 객체입니다. 폰트 패밀리 [제공자](#fontprovider)에 따라 자동으로 타입이 지정됩니다. + +```js +options: { + experimental: { + glyphs: ["a"] + } +} +``` + +### font.display + +

+ +**타입:** `"auto" | "block" | "swap" | "fallback" | "optional"`
+**기본값:** `"swap"`
+ +

+ +다운로드되어 사용할 준비가 된 시점에 따라 [폰트가 표시되는 방식](https://developer.mozilla.org/ko/docs/Web/CSS/@font-face/font-display)을 정의합니다. + +```js +display: "block" +``` + +### font.unicodeRange + +

+ +**타입:** `Array`
+**기본값:** `undefined`
+ +

+ +특정 [유니코드 문자 범위](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@font-face/unicode-range)를 기반으로 폰트를 다운로드하고 사용해야 하는 시점을 결정합니다. 페이지의 문자가 구성된 범위와 일치하면 브라우저는 폰트를 다운로드하여 페이지에서 모든 문자를 사용할 수 있게 됩니다. 단일 폰트에 대해 미리 로드된 문자 서브셋을 구성하려면 대신 [subsets](#fontsubsets) 속성을 참조하세요. + +이는 웹사이트의 특정 부분에서 다른 문자를 사용하고 별도의 폰트로 표시되는 경우 불필요한 폰트 다운로드를 피하기 위한 현지화에 유용할 수 있습니다. 예를 들어 영어와 일본어 버전을 모두 제공하는 웹사이트는 `unicodeRange`에 제공된 일본어 문자가 포함되지 않은 영어 버전 페이지에서 브라우저가 일본어 폰트를 다운로드하지 않도록 방지할 수 있습니다. + +```js +unicodeRange: ["U+26"] +``` + +### font.stretch + +

+ +**타입:** `string`
+**기본값:** `undefined`
+ +

+ +[폰트 장평](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@font-face/font-stretch)입니다. + +```js +stretch: "condensed" +``` + +### font.featureSettings + +

+ +**타입:** `string`
+**기본값:** `undefined`
+ +

+ +[타이포그래피 폰트 기능](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@font-face/font-feature-settings) (예: 합자, 작은 대문자, 스와시)을 제어합니다. + +```js +featureSettings: "'smcp' 2" +``` + +### font.variationSettings + +

+ +**타입:** `string`
+**기본값:** `undefined`
+ +

+ +폰트 [변형 설정](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@font-face/font-variation-settings)입니다. + +```js +variationSettings: "'xhgt' 0.7" +``` From 12aff19eb3c7d3276ae2f9f479469a0472ea1428 Mon Sep 17 00:00:00 2001 From: Junseong Park <39112954+jsparkdev@users.noreply.github.com> Date: Tue, 17 Mar 2026 13:42:11 +0900 Subject: [PATCH 2/6] i18n(ko-KR): update `api-reference.mdx` --- .../docs/ko/reference/api-reference.mdx | 243 +++++++++++------- 1 file changed, 143 insertions(+), 100 deletions(-) diff --git a/src/content/docs/ko/reference/api-reference.mdx b/src/content/docs/ko/reference/api-reference.mdx index 5a1825ee1fe6e..3218f94752a88 100644 --- a/src/content/docs/ko/reference/api-reference.mdx +++ b/src/content/docs/ko/reference/api-reference.mdx @@ -5,7 +5,7 @@ sidebar: i18nReady: true tableOfContents: minHeadingLevel: 2 - maxHeadingLevel: 4 + maxHeadingLevel: 3 --- import Since from '~/components/Since.astro'; import { Tabs, TabItem } from '@astrojs/starlight/components'; @@ -723,7 +723,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } `Astro.cookies.get()`을 통해 쿠키를 가져올 때 반환되는 타입입니다. 다음과 같은 속성을 가집니다: -##### `value` +##### `AstroCookie.value`

@@ -732,7 +732,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } 쿠키의 원시 문자열 값입니다. -##### `json` +##### `AstroCookie.json()`

@@ -741,7 +741,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } `JSON.parse()`를 통해 쿠키 값을 구문 분석하여 객체를 반환합니다. 쿠키 값이 유효한 JSON이 아닐 경우 오류가 발생합니다. -##### `number` +##### `AstroCookie.number()`

@@ -750,7 +750,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } 쿠키 값을 숫자로 구문 분석합니다. 유효한 숫자가 아닌 경우 NaN을 반환합니다. -##### `boolean` +##### `AstroCookie.boolean()`

@@ -765,7 +765,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } `AstroCookieGetOption` 인터페이스를 사용하면 쿠키를 받을 때 옵션을 지정할 수 있습니다. -##### `decode` +##### `AstroCookieGetOptions.decode()`

**타입:** `(value: string) => string` @@ -779,7 +779,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } `AstroCookieSetOptions`는 쿠키를 설정할 때 `Astro.cookies.set()`에 전달하여 쿠키 직렬화 방식을 사용자 지정할 수 있는 객체입니다. -##### `domain` +##### `AstroCookieSetOptions.domain`

@@ -788,7 +788,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } 도메인을 지정합니다. 도메인을 설정하지 않으면 대부분의 클라이언트는 현재 도메인에 적용되는 것으로 해석합니다. -##### `expires` +##### `AstroCookieSetOptions.expires`

@@ -797,7 +797,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } 쿠키가 만료되는 날짜를 지정합니다. -##### `httpOnly` +##### `AstroCookieSetOptions.httpOnly`

@@ -806,7 +806,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } true이면 클라이언트 측에서 쿠키에 액세스할 수 없습니다. -##### `maxAge` +##### `AstroCookieSetOptions.maxAge`

@@ -815,7 +815,7 @@ true이면 클라이언트 측에서 쿠키에 액세스할 수 없습니다. 쿠키가 유효한 기간(초)을 숫자로 지정합니다. -##### `path` +##### `AstroCookieSetOptions.path`

@@ -824,7 +824,7 @@ true이면 클라이언트 측에서 쿠키에 액세스할 수 없습니다. 쿠키가 적용되는 도메인의 하위 경로를 지정합니다. -##### `partitioned` +##### `AstroCookieSetOptions.partitioned`

@@ -836,7 +836,7 @@ true인 경우, 이 쿠키는 [파티셔닝된 쿠키](https://developer.mozilla 파티셔닝된 쿠키는 `secure: true`로 설정해야 합니다. -##### `sameSite` +##### `AstroCookieSetOptions.sameSite`

@@ -845,7 +845,7 @@ true인 경우, 이 쿠키는 [파티셔닝된 쿠키](https://developer.mozilla [SameSite](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7) 쿠키 헤더의 값을 지정합니다. -##### `secure` +##### `AstroCookieSetOptions.secure`

@@ -854,7 +854,7 @@ true인 경우, 이 쿠키는 [파티셔닝된 쿠키](https://developer.mozilla true인 경우 쿠키는 https 사이트에만 설정됩니다. -##### `encode` +##### `AstroCookieSetOptions.encode()`

@@ -879,7 +879,7 @@ true인 경우 쿠키는 https 사이트에만 설정됩니다. Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 내용은 [세션 가이드](/ko/guides/sessions/)를 참조하세요. -#### `get()` +#### `session.get()`

@@ -911,7 +911,7 @@ Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 -#### `set()` +#### `session.set()`

@@ -947,7 +947,7 @@ Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 -#### `regenerate()` +#### `session.regenerate()`

@@ -981,7 +981,7 @@ Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 -#### `destroy()` +#### `session.destroy()`

@@ -1013,7 +1013,7 @@ Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 -#### `load()` +#### `session.load()`

@@ -1056,117 +1056,160 @@ ID를 사용하여 세션을 로드합니다. 일반적인 사용 환경에서 +### `csp` -### 더 이상 사용되지 않는 객체 속성 +

-#### `Astro.glob()` +**타입**: `object | undefined` + +

-:::caution[v5.0에서 더 이상 사용되지 않음] -[Vite의 `import.meta.glob`](https://ko.vite.dev/guide/features.html#glob-import)을 사용하여 프로젝트 파일을 쿼리합니다. +Astro의 CSP 런타임 API는 문서가 로드할 수 있는 리소스를 제어하여 특정 유형의 보안 위협을 최소화하는 데 도움이 되는 [콘텐츠 보안 정책(CSP)](https://developer.mozilla.org/ko/docs/Web/HTTP/Guides/CSP) 지원을 활성화합니다. 이는 [교차 사이트 스크립팅(XSS)](https://developer.mozilla.org/ko/docs/Glossary/Cross-site_scripting) 공격에 대한 추가적인 보호를 제공합니다. -`Astro.glob('../pages/post/*.md')`를 다음과 같이 변환할 수 있습니다. +`.astro` 컴포넌트 내부의 `Astro` 전역 객체 또는 엔드포인트 및 미들웨어의 `APIContext` 타입을 사용하여 페이지별로 `` 요소를 사용자 정의할 수 있습니다. -`Object.values(import.meta.glob('../pages/post/*.md', { eager: true }));` +리소스가 여러 번 삽입되거나 여러 소스(예: [`csp` 구성](/ko/reference/configuration-reference/#securitycsp)에 정의된 것과 다음 CSP 런타임 API를 사용하여 추가된 것)에서 제공되는 경우, Astro는 모든 리소스를 병합하고 중복을 제거하여 `` 요소를 생성합니다. -더 많은 정보와 사용법은 [가져오기 가이드](/ko/guides/imports/#importmetaglob)를 참조하세요. -::: -`Astro.glob()`은 정적 사이트 설정에 많은 로컬 파일을 로드하는 방법입니다. +#### `csp.insertDirective()` + +

+ +**타입:** `(directive: CspDirective) => void`
+ +

+ +현재 페이지에 단일 지시어를 추가합니다. 이 메서드를 여러 번 호출하여 지시어를 추가할 수 있습니다. -```astro +```astro title="src/pages/index.astro" --- -// src/components/my-component.astro -const posts = await Astro.glob('../pages/post/*.md'); // ./src/pages/post/*.md에 위치한 게시물의 배열을 반환합니다. +Astro.csp?.insertDirective("default-src 'self'"); +Astro.csp?.insertDirective("img-src 'self' https://images.cdn.example.com"); --- +``` -
-{posts.slice(0, 3).map((post) => ( -
-

{post.frontmatter.title}

-

{post.frontmatter.description}

- Read more -
-))} -
+빌드 후, 이 개별 페이지의 `` 요소는 기존 `script-src` 및 `style-src` 지시어와 함께 추가된 지시어를 포함하게 됩니다. + +```html + ``` -`.glob()`은 하나의 매개변수만 받습니다: 가져오려는 로컬 파일의 상대 URL. 이 함수는 비동기식이며 일치하는 파일에서 내보낸 값들로 이루어진 배열을 반환합니다. +#### `csp.insertStyleResource()` + +

-`.glob()`은 통계적으로 분석할 수 없으므로 변수나 보간하는 문자열을 받을 수 없습니다. (해결 방법은 [가져오기 가이드](/ko/guides/imports/#지원되는-값)를 참조하세요.) 이는 `Astro.glob()`이 Vite의 [`import.meta.glob()`](https://ko.vite.dev/guide/features.html#glob-import)의 래퍼이기 때문입니다. +**타입:** `(resource: string) => void`
+ +

-:::note -다음과 같은 경우 Astro 프로젝트에서 `import.meta.glob()`를 사용할 수도 있습니다: -- API 라우트와 같이 `.astro`가 아닌 파일인 경우. `Astro.glob()`은 `.astro` 파일에서만 사용할 수 있지만 `import.meta.glob()`은 프로젝트의 어느 곳에서나 사용할 수 있습니다. -- 각 파일을 즉시 로드하고 싶지 않은 경우. `import.meta.glob()`은 콘텐츠 자체를 반환하는 대신 파일 콘텐츠를 가져오는 함수를 반환할 수 있습니다. 여기에는 가져온 파일에 대한 모든 스타일과 스크립트가 포함됩니다. 파일이 실제로 사용되는지 여부는 런타임이 아닌 정적 분석에 의해 결정되므로 이러한 파일은 번들로 묶여 페이지에 추가됩니다. -- 각 파일의 경로에 액세스하려는 경우. `import.meta.glob()`은 파일 경로의 콘텐츠 맵을 반환하고 `Astro.glob()`은 콘텐츠 목록을 반환합니다. -- 여러 패턴을 전달하려는 경우(예를 들어, 특정 파일을 필터링하기 위한 "네거티브 패턴" 등을 추가하려는 경우). `import.meta.glob()`는 선택적으로 단일 문자열이 아닌 문자열 배열을 받을 수 있습니다. +`style-src` 지시어에 사용할 새로운 리소스를 삽입합니다. -[Vite 문서](https://ko.vite.dev/guide/features.html#glob-import)에서 더 자세히 알아보세요. -::: +```astro title="src/pages/index.astro" +--- +Astro.csp?.insertStyleResource("https://styles.cdn.example.com"); +--- +``` -##### Markdown 파일 - -`Astro.glob()`으로 가져온 Markdown 파일은 다음과 같은 `MarkdownInstance` 인터페이스를 반환합니다: - -```ts -export interface MarkdownInstance> { - /* 이 파일의 YAML/TOML 프런트매터에 지정된 모든 데이터 */ - frontmatter: T; - /* 이 파일의 절대 경로 */ - file: string; - /* 이 파일의 렌더링 경로 */ - url: string | undefined; - /* 이 파일의 콘텐츠를 렌더링하는 Astro 컴포넌트 */ - Content: AstroComponentFactory; - /** (Markdown 전용) 원시 Markdown 파일 콘텐츠, 레이아웃 HTML 및 YAML/TOML 프런트매터 제외 */ - rawContent(): string; - /** (Markdown 전용) HTML로 컴파일된 Markdown 파일, 레이아웃 HTML 제외 */ - compiledContent(): string; - /* 이 파일의 h1...h6 요소의 배열을 반환하는 함수 */ - getHeadings(): Promise<{ depth: number; slug: string; text: string }[]>; - default: AstroComponentFactory; -} +빌드 후, 이 개별 페이지의 `` 요소는 기본 `style-src` 지시어에 지정된 소스를 추가합니다. + +```html + ``` -선택적으로 TypeScript 제네릭을 사용하여 `frontmatter` 변수에 타입을 제공할 수 있습니다. +#### `csp.insertStyleHash()` -```astro +

+ +**타입:** `(hash: CspHash) => void`
+ +

+ +`style-src` 지시어에 새로운 해시를 추가합니다. + +```astro title="src/pages/index.astro" --- -interface Frontmatter { - title: string; - description?: string; -} -const posts = await Astro.glob('../pages/post/*.md'); +Astro.csp?.insertStyleHash("sha512-styleHash"); --- +``` + +빌드 후, 이 개별 페이지의 `` 요소는 기본 `style-src` 지시어에 지정된 해시를 추가합니다. -
    - {posts.map(post =>
  • {post.frontmatter.title}
  • )} -
+```html + ``` -##### Astro 파일 +#### `csp.insertScriptResource()` + +

-Astro 파일에는 다음과 같은 인터페이스가 있습니다: +**타입:** `(resource: string) => void`
+ +

-```ts -export interface AstroInstance { - /* 이 파일의 파일 경로 */ - file: string; - /* 이 파일의 URL(pages 디렉터리에 있는 경우) */ - url: string | undefined; - default: AstroComponentFactory; -} +`script-src` 지시어에 사용할 새로운 유효한 소스를 삽입합니다. + +```astro title="src/pages/index.astro" +--- +Astro.csp?.insertScriptResource("https://scripts.cdn.example.com"); +--- ``` -##### 기타 파일 +빌드 후, 이 개별 페이지의 `` 요소는 기본 `script-src` 지시어에 지정된 소스를 추가합니다. -기타 파일에는 다양한 인터페이스가 있을 수 있지만 `Astro.glob()`은 인식할 수 없는 파일 형식이 정확히 무엇인지 알고 있는 경우 TypeScript 제네릭을 허용합니다. +```html + +``` + +#### `csp.insertScriptHash()` + +

+ +**타입:** `(hash: CspHash) => void`
+ +

-```ts +`script-src` 지시어에 새로운 해시를 추가합니다. + +```astro title="src/pages/index.astro" --- -interface CustomDataFile { - default: Record; -} -const data = await Astro.glob('../data/**/*.js'); +Astro.csp?.insertScriptHash("sha512-scriptHash"); --- ``` + +빌드 후, 이 개별 페이지의 `` 요소는 기본 `script-src` 지시어에 지정된 해시를 추가합니다. + +```html + +``` From 407ea8434cf13fa63cfebba0651a67297bc03520 Mon Sep 17 00:00:00 2001 From: Junseong Park <39112954+jsparkdev@users.noreply.github.com> Date: Tue, 17 Mar 2026 13:45:14 +0900 Subject: [PATCH 3/6] i18n(ko-KR): update `astro-config.mdx` --- .../ko/reference/modules/astro-config.mdx | 268 +++++++++++++++++- 1 file changed, 260 insertions(+), 8 deletions(-) diff --git a/src/content/docs/ko/reference/modules/astro-config.mdx b/src/content/docs/ko/reference/modules/astro-config.mdx index a593176289e3c..6f53745418d0a 100644 --- a/src/content/docs/ko/reference/modules/astro-config.mdx +++ b/src/content/docs/ko/reference/modules/astro-config.mdx @@ -8,16 +8,19 @@ tableOfContents: maxHeadingLevel: 6 --- +import ReadMore from '~/components/ReadMore.astro'; import Since from '~/components/Since.astro';

-이 `astro:config` 가상 모듈은 완전하지는 않지만 직렬화 가능하고 타입 안전한 버전의 Astro 구성을 제공합니다. 구성 값의 서로 다른 하위 집합에 접근하기 위한 두 개의 하위 모듈 [`/client`](#astroconfigclient에서-가져오기) 및 [`/server`](#astroconfigserver에서-가져오기)가 있습니다. +`astro:config` 가상 모듈은 Astro 구성의 일부 속성들을 직렬화 가능하고 타입 안전한 버전으로 노출합니다. 구성 값의 서로 다른 하위 집합에 액세스하기 위한 두 가지 하위 모듈인 [`/client`](#astroconfigclient에서-가져오기) 및 [`/server`](#astroconfigserver에서-가져오기)가 있습니다. -`astro:config/server`에서 사용 가능한 모든 구성 값에 접근할 수 있습니다. 하지만 클라이언트에서 실행되는 코드의 경우, `astro:config/client`를 통해 노출된 값만 사용할 수 있습니다. 이는 일부 데이터만 클라이언트에 제공함으로써 정보를 보호합니다. +모든 사용 가능한 구성 값은 `astro:config/server`에서 액세스할 수 있습니다. 하지만 클라이언트에서 실행되는 코드의 경우 `astro:config/client`에서 노출된 값만 사용할 수 있습니다. 이는 일부 데이터만 클라이언트에 제공함으로써 정보를 보호합니다. ## `astro:config/client`에서 가져오기 +가상 구성 모듈의 `client` 디렉터리에서 다음 도우미를 가져옵니다. + ```js import { i18n, @@ -29,7 +32,7 @@ import { } from "astro:config/client"; ``` -클라이언트 측 코드에는 이 하위 모듈을 사용하세요. +클라이언트 측 코드에는 이 하위 모듈을 사용하세요: ```js title="src/utils.js" ins={1} ins="trailingSlash" import { trailingSlash } from "astro:config/client"; @@ -43,7 +46,7 @@ function addForwardSlash(path) { } ``` -`astro:config/client`에서 사용할 수 있는 구성 가져오기에 대해 자세히 알아보세요. +`astro:config/client`에서 사용할 수 있는 구성 가져오기에 대해 자세히 알아보세요: - [`i18n`](/ko/reference/configuration-reference/#i18n) - [`trailingSlash`](/ko/reference/configuration-reference/#trailingslash) @@ -53,8 +56,11 @@ function addForwardSlash(path) { - [`compressHTML`](/ko/reference/configuration-reference/#compresshtml) + ## `astro:config/server`에서 가져오기 +가상 구성 모듈의 `server` 디렉터리에서 다음 도우미를 가져옵니다. + ```js import { i18n, @@ -71,9 +77,9 @@ import { } from "astro:config/server"; ``` -이러한 가져오기에는 `astro:config/client`에서 사용할 수 있는 것은 물론, 클라이언트에 노출하기에 안전하지 않은 파일 시스템 구성에 대한 민감한 정보도 포함됩니다. +이러한 가져오기에는 `astro:config/client`에서 사용할 수 있는 모든 항목뿐만 아니라, 클라이언트에 노출하기에 안전하지 않은 파일 시스템 구성에 대한 민감한 정보도 포함됩니다. -서버 측 코드에는 이 하위 모듈을 사용하세요. +서버 측 코드에는 이 하위 모듈을 사용하세요: ```js title="astro.config.mjs" import { integration } from "./integration.mjs"; @@ -96,7 +102,7 @@ export default function() { hooks: { "astro:build:done": () => { let file = new URL("result.json", outDir); - // 특정 연산으로 데이터를 생성합니다. + // 데이터 생성 작업 let data = JSON.stringify([]); writeFileSync(fileURLToPath(file), data, "utf-8"); } @@ -105,7 +111,7 @@ export default function() { } ``` -`astro:config/server`에서 사용할 수 있는 구성 가져오기에 대해 자세히 알아보세요. +`astro:config/server`에서 사용할 수 있는 구성 가져오기에 대해 자세히 알아보세요: - [`i18n`](/ko/reference/configuration-reference/#i18n) - [`trailingSlash`](/ko/reference/configuration-reference/#trailingslash) @@ -120,3 +126,249 @@ export default function() { - [`publicDir`](/ko/reference/configuration-reference/#publicdir) - [`root`](/ko/reference/configuration-reference/#root) - [`compressHTML`](/ko/reference/configuration-reference/#compresshtml) + +## `astro/config`에서 가져오기 + +일반 구성 모듈에서 다음 도우미를 가져옵니다. + +```js +import { + defineConfig, + envField, + fontProviders, + getViteConfig, + mergeConfig, + passthroughImageService, + sessionDrivers, + sharpImageService, + validateConfig, +} from "astro/config"; +``` + +### `defineConfig()` + +

+ +**타입:** (config: AstroUserConfig) => AstroUserConfig +

+ +[지원되는 Astro 구성 파일](/ko/guides/configuring-astro/#astro-구성-파일)에서 타입 안전성을 갖춘 프로젝트를 구성합니다. + +### `envField` + +

+ +**타입:** `object`
+ +

+ +[환경 변수를 정의](/ko/reference/configuration-reference/#envschema)할 때 지원되는 데이터 타입을 설명합니다. + +각 데이터 타입은 `context` (`"client"` 또는 `"server"`) 및 `access` (`"secret"` 또는 `"public"`)와 함께 [변수 타입](/ko/guides/environment-variables/#변수-타입)을 정의해야 합니다. 또한 `default` 값을 정의하고, 변수가 `optional`인지 여부(기본값 `false`)를 지정할 수 있으며, 일부 데이터 타입은 선택적 유효성 검사 메서드를 제공합니다. + +Astro 프로젝트에서 [타입 안전한 환경 변수를 사용하는 방법](/ko/guides/environment-variables/#타입-안전-환경-변수)에 대해 자세히 알아보세요. + +#### `envField.string()` + +

+ +**타입:** `(options: StringFieldInput) => StringField` +

+ +문자열 타입의 환경 변수를 정의합니다. `max`, `min`, `length`, `url`, `includes`, `startsWith`, `endsWith` 속성을 사용하여 [Zod로 문자열 유효성 검사](https://zod.dev/api#strings)를 수행할 수 있습니다. + +다음 예시는 API URL을 저장하는 환경 변수의 예상 형태를 정의합니다. + +```js title="astro.config.mjs" "envField" +import { defineConfig, envField } from "astro/config"; + +export default defineConfig({ + env: { + schema: { + API_URL: envField.string({ + context: "client", + access: "public", + optional: false, + default: "", + min: 12, + url: true, + includes: "astro", + startsWith: "https", + }), + } + } +}) +``` + +#### `envField.number()` + +

+ +**타입:** `(options: NumberFieldInput) => NumberField` +

+ +숫자 타입의 환경 변수를 정의합니다. `gt`, `lt`, `min`, `max`, `int` 속성을 사용하여 [Zod로 숫자 유효성 검사](https://zod.dev/api#numbers)를 수행할 수 있습니다. + +다음 예시는 API 포트를 저장하는 환경 변수의 예상 형태를 정의합니다. + +```js title="astro.config.mjs" "envField" +import { defineConfig, envField } from "astro/config"; + +export default defineConfig({ + env: { + schema: { + API_PORT: envField.number({ + context: "server", + access: "public", + optional: true, + default: 4321, + min: 2, + int: true, + }), + } + } +}) +``` + +#### `envField.boolean()` + +

+ +**타입:** `(options: BooleanFieldInput) => BooleanField` +

+ +불리언 타입의 환경 변수를 정의합니다. + +다음 예시는 분석 활성화 여부를 저장하는 환경 변수의 예상 형태를 정의합니다. + +```js title="astro.config.mjs" "envField" +import { defineConfig, envField } from "astro/config"; + +export default defineConfig({ + env: { + schema: { + ANALYTICS_ENABLED: envField.boolean({ + context: "client", + access: "public", + optional: true, + default: true, + }), + } + } +}) +``` + +#### `envField.enum()` + +

+ +**타입:** `(options: EnumFieldInput) => EnumField` +

+ +허용된 `values`를 배열로 제공하여 열거형 타입의 환경 변수를 정의합니다. + +다음 예시는 구성된 디버그 모드를 저장하는 환경 변수의 예상 형태를 정의합니다. + +```js title="astro.config.mjs" "envField" {9} +import { defineConfig, envField } from "astro/config"; + +export default defineConfig({ + env: { + schema: { + DEBUG_MODE: envField.enum({ + context: "server", + access: "public", + values: ['info', 'warnings', 'errors'], // 필수 + optional: true, + default: 'errors', + }), + } + } +}) +``` + +### `fontProviders` + +

+ +**타입:** `object`
+ +

+ +[구성된 폰트를 가져오기](/ko/reference/configuration-reference/#fontprovider) 위해 사용되는 [내장 제공자](/ko/reference/font-provider-reference/#built-in-providers)를 설명합니다. + +### `getViteConfig()` + +

+ +**타입:** (userViteConfig: ViteUserConfig, inlineAstroConfig?: AstroInlineConfig) => ViteUserConfigFn +

+ +사용자 정의 Vite 구성 객체와 선택적 Astro 구성 객체를 병합하여 사용할 Vite 구성을 가져옵니다. 이는 [테스팅을 위해 Vitest를 설정](/ko/guides/testing/#vitest)할 때 유용합니다. + +### `mergeConfig()` + +[프로그래밍 방식 API 참조의 `mergeConfig()`](/ko/reference/programmatic-reference/#mergeconfig)를 확인하세요. + +### `passthroughImageService()` + +

+ +**타입:** () => ImageServiceConfig +

+ +no-op 이미지 서비스를 가져옵니다. 이는 어댑터가 Astro의 내장 Sharp 이미지 최적화를 지원하지 않지만 [`` 및 `` 컴포넌트를 사용](/ko/guides/images/#astro-컴포넌트의-이미지)하고 싶을 때 유용합니다. + +다음 예시는 Sharp 이미지 처리를 피하기 위해 Astro 구성 파일에서 `passthroughImageService()`를 이미지 서비스로 정의합니다. + +```js title="astro.config.mjs" "passthroughImageService" +import { defineConfig, passthroughImageService } from "astro/config"; + +export default defineConfig({ + image: { + service: passthroughImageService() + } +}); +``` + +[no-op 패스스루 서비스 구성](/ko/guides/images/#무작동-패스스루-서비스-구성)에 대해 자세히 알아보세요. + +### `sessionDrivers` + +

+ +**타입:** `object`
+ +

+ +[세션 저장소](/ko/reference/configuration-reference/#세션-옵션)에 사용되는 [내장 드라이버](/ko/reference/session-driver-reference/#built-in-drivers)를 설명합니다. + +다음 예시는 세션을 활성화하기 위해 Redis 드라이버를 구성합니다. + +```js title="astro.config.mjs" "sessionDrivers" +import { defineConfig, sessionDrivers } from "astro/config"; + +export default defineConfig({ + session: { + driver: sessionDrivers.redis({ + url: process.env.REDIS_URL + }), + } +}) +``` + +Astro 프로젝트에서 [세션을 사용하는 방법](/ko/guides/sessions/)에 대해 자세히 알아보세요. + +### `sharpImageService()` + +

+ +**타입:** (config?: SharpImageServiceConfig) => ImageServiceConfig
+ +

+ +Astro의 이미지 자산을 처리하는 데 사용되는 Sharp 서비스를 가져옵니다. 이는 [Sharp 구성 옵션](/ko/reference/configuration-reference/#imageservice)을 설명하는 선택적 객체를 인자로 받습니다. + +### `validateConfig()` + +[프로그래밍 방식 API 참조의 `validateConfig()`](/ko/reference/programmatic-reference/#validateconfig)를 확인하세요. From 0c4bf539dc4cefe224697989a5e27c2b0804426f Mon Sep 17 00:00:00 2001 From: Junseong Park <39112954+jsparkdev@users.noreply.github.com> Date: Wed, 18 Mar 2026 12:31:58 +0900 Subject: [PATCH 4/6] revert `api-reference.mdx`, `astro-config.mdx` --- .../docs/ko/reference/api-reference.mdx | 243 +++++++--------- .../ko/reference/modules/astro-config.mdx | 268 +----------------- 2 files changed, 108 insertions(+), 403 deletions(-) diff --git a/src/content/docs/ko/reference/api-reference.mdx b/src/content/docs/ko/reference/api-reference.mdx index 3218f94752a88..5a1825ee1fe6e 100644 --- a/src/content/docs/ko/reference/api-reference.mdx +++ b/src/content/docs/ko/reference/api-reference.mdx @@ -5,7 +5,7 @@ sidebar: i18nReady: true tableOfContents: minHeadingLevel: 2 - maxHeadingLevel: 3 + maxHeadingLevel: 4 --- import Since from '~/components/Since.astro'; import { Tabs, TabItem } from '@astrojs/starlight/components'; @@ -723,7 +723,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } `Astro.cookies.get()`을 통해 쿠키를 가져올 때 반환되는 타입입니다. 다음과 같은 속성을 가집니다: -##### `AstroCookie.value` +##### `value`

@@ -732,7 +732,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } 쿠키의 원시 문자열 값입니다. -##### `AstroCookie.json()` +##### `json`

@@ -741,7 +741,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } `JSON.parse()`를 통해 쿠키 값을 구문 분석하여 객체를 반환합니다. 쿠키 값이 유효한 JSON이 아닐 경우 오류가 발생합니다. -##### `AstroCookie.number()` +##### `number`

@@ -750,7 +750,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } 쿠키 값을 숫자로 구문 분석합니다. 유효한 숫자가 아닌 경우 NaN을 반환합니다. -##### `AstroCookie.boolean()` +##### `boolean`

@@ -765,7 +765,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } `AstroCookieGetOption` 인터페이스를 사용하면 쿠키를 받을 때 옵션을 지정할 수 있습니다. -##### `AstroCookieGetOptions.decode()` +##### `decode`

**타입:** `(value: string) => string` @@ -779,7 +779,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } `AstroCookieSetOptions`는 쿠키를 설정할 때 `Astro.cookies.set()`에 전달하여 쿠키 직렬화 방식을 사용자 지정할 수 있는 객체입니다. -##### `AstroCookieSetOptions.domain` +##### `domain`

@@ -788,7 +788,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } 도메인을 지정합니다. 도메인을 설정하지 않으면 대부분의 클라이언트는 현재 도메인에 적용되는 것으로 해석합니다. -##### `AstroCookieSetOptions.expires` +##### `expires`

@@ -797,7 +797,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } 쿠키가 만료되는 날짜를 지정합니다. -##### `AstroCookieSetOptions.httpOnly` +##### `httpOnly`

@@ -806,7 +806,7 @@ const { data, error } = await Astro.callAction(actions.logout, { userId: '123' } true이면 클라이언트 측에서 쿠키에 액세스할 수 없습니다. -##### `AstroCookieSetOptions.maxAge` +##### `maxAge`

@@ -815,7 +815,7 @@ true이면 클라이언트 측에서 쿠키에 액세스할 수 없습니다. 쿠키가 유효한 기간(초)을 숫자로 지정합니다. -##### `AstroCookieSetOptions.path` +##### `path`

@@ -824,7 +824,7 @@ true이면 클라이언트 측에서 쿠키에 액세스할 수 없습니다. 쿠키가 적용되는 도메인의 하위 경로를 지정합니다. -##### `AstroCookieSetOptions.partitioned` +##### `partitioned`

@@ -836,7 +836,7 @@ true인 경우, 이 쿠키는 [파티셔닝된 쿠키](https://developer.mozilla 파티셔닝된 쿠키는 `secure: true`로 설정해야 합니다. -##### `AstroCookieSetOptions.sameSite` +##### `sameSite`

@@ -845,7 +845,7 @@ true인 경우, 이 쿠키는 [파티셔닝된 쿠키](https://developer.mozilla [SameSite](https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis-09#section-5.4.7) 쿠키 헤더의 값을 지정합니다. -##### `AstroCookieSetOptions.secure` +##### `secure`

@@ -854,7 +854,7 @@ true인 경우, 이 쿠키는 [파티셔닝된 쿠키](https://developer.mozilla true인 경우 쿠키는 https 사이트에만 설정됩니다. -##### `AstroCookieSetOptions.encode()` +##### `encode`

@@ -879,7 +879,7 @@ true인 경우 쿠키는 https 사이트에만 설정됩니다. Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 내용은 [세션 가이드](/ko/guides/sessions/)를 참조하세요. -#### `session.get()` +#### `get()`

@@ -911,7 +911,7 @@ Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 -#### `session.set()` +#### `set()`

@@ -947,7 +947,7 @@ Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 -#### `session.regenerate()` +#### `regenerate()`

@@ -981,7 +981,7 @@ Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 -#### `session.destroy()` +#### `destroy()`

@@ -1013,7 +1013,7 @@ Astro 프로젝트에서 세션을 사용하는 방법에 대한 더 자세한 -#### `session.load()` +#### `load()`

@@ -1056,160 +1056,117 @@ ID를 사용하여 세션을 로드합니다. 일반적인 사용 환경에서 -### `csp` -

- -**타입**: `object | undefined` - -

+### 더 이상 사용되지 않는 객체 속성 -Astro의 CSP 런타임 API는 문서가 로드할 수 있는 리소스를 제어하여 특정 유형의 보안 위협을 최소화하는 데 도움이 되는 [콘텐츠 보안 정책(CSP)](https://developer.mozilla.org/ko/docs/Web/HTTP/Guides/CSP) 지원을 활성화합니다. 이는 [교차 사이트 스크립팅(XSS)](https://developer.mozilla.org/ko/docs/Glossary/Cross-site_scripting) 공격에 대한 추가적인 보호를 제공합니다. +#### `Astro.glob()` -`.astro` 컴포넌트 내부의 `Astro` 전역 객체 또는 엔드포인트 및 미들웨어의 `APIContext` 타입을 사용하여 페이지별로 `` 요소를 사용자 정의할 수 있습니다. +:::caution[v5.0에서 더 이상 사용되지 않음] +[Vite의 `import.meta.glob`](https://ko.vite.dev/guide/features.html#glob-import)을 사용하여 프로젝트 파일을 쿼리합니다. -리소스가 여러 번 삽입되거나 여러 소스(예: [`csp` 구성](/ko/reference/configuration-reference/#securitycsp)에 정의된 것과 다음 CSP 런타임 API를 사용하여 추가된 것)에서 제공되는 경우, Astro는 모든 리소스를 병합하고 중복을 제거하여 `` 요소를 생성합니다. +`Astro.glob('../pages/post/*.md')`를 다음과 같이 변환할 수 있습니다. +`Object.values(import.meta.glob('../pages/post/*.md', { eager: true }));` -#### `csp.insertDirective()` - -

- -**타입:** `(directive: CspDirective) => void`
- -

+더 많은 정보와 사용법은 [가져오기 가이드](/ko/guides/imports/#importmetaglob)를 참조하세요. +::: -현재 페이지에 단일 지시어를 추가합니다. 이 메서드를 여러 번 호출하여 지시어를 추가할 수 있습니다. +`Astro.glob()`은 정적 사이트 설정에 많은 로컬 파일을 로드하는 방법입니다. -```astro title="src/pages/index.astro" +```astro --- -Astro.csp?.insertDirective("default-src 'self'"); -Astro.csp?.insertDirective("img-src 'self' https://images.cdn.example.com"); +// src/components/my-component.astro +const posts = await Astro.glob('../pages/post/*.md'); // ./src/pages/post/*.md에 위치한 게시물의 배열을 반환합니다. --- -``` -빌드 후, 이 개별 페이지의 `` 요소는 기존 `script-src` 및 `style-src` 지시어와 함께 추가된 지시어를 포함하게 됩니다. - -```html - +
+{posts.slice(0, 3).map((post) => ( +
+

{post.frontmatter.title}

+

{post.frontmatter.description}

+ Read more +
+))} +
``` -#### `csp.insertStyleResource()` - -

- -**타입:** `(resource: string) => void`
- -

+`.glob()`은 하나의 매개변수만 받습니다: 가져오려는 로컬 파일의 상대 URL. 이 함수는 비동기식이며 일치하는 파일에서 내보낸 값들로 이루어진 배열을 반환합니다. -`style-src` 지시어에 사용할 새로운 리소스를 삽입합니다. +`.glob()`은 통계적으로 분석할 수 없으므로 변수나 보간하는 문자열을 받을 수 없습니다. (해결 방법은 [가져오기 가이드](/ko/guides/imports/#지원되는-값)를 참조하세요.) 이는 `Astro.glob()`이 Vite의 [`import.meta.glob()`](https://ko.vite.dev/guide/features.html#glob-import)의 래퍼이기 때문입니다. -```astro title="src/pages/index.astro" ---- -Astro.csp?.insertStyleResource("https://styles.cdn.example.com"); ---- -``` +:::note +다음과 같은 경우 Astro 프로젝트에서 `import.meta.glob()`를 사용할 수도 있습니다: +- API 라우트와 같이 `.astro`가 아닌 파일인 경우. `Astro.glob()`은 `.astro` 파일에서만 사용할 수 있지만 `import.meta.glob()`은 프로젝트의 어느 곳에서나 사용할 수 있습니다. +- 각 파일을 즉시 로드하고 싶지 않은 경우. `import.meta.glob()`은 콘텐츠 자체를 반환하는 대신 파일 콘텐츠를 가져오는 함수를 반환할 수 있습니다. 여기에는 가져온 파일에 대한 모든 스타일과 스크립트가 포함됩니다. 파일이 실제로 사용되는지 여부는 런타임이 아닌 정적 분석에 의해 결정되므로 이러한 파일은 번들로 묶여 페이지에 추가됩니다. +- 각 파일의 경로에 액세스하려는 경우. `import.meta.glob()`은 파일 경로의 콘텐츠 맵을 반환하고 `Astro.glob()`은 콘텐츠 목록을 반환합니다. +- 여러 패턴을 전달하려는 경우(예를 들어, 특정 파일을 필터링하기 위한 "네거티브 패턴" 등을 추가하려는 경우). `import.meta.glob()`는 선택적으로 단일 문자열이 아닌 문자열 배열을 받을 수 있습니다. -빌드 후, 이 개별 페이지의 `` 요소는 기본 `style-src` 지시어에 지정된 소스를 추가합니다. +[Vite 문서](https://ko.vite.dev/guide/features.html#glob-import)에서 더 자세히 알아보세요. +::: -```html - +##### Markdown 파일 + +`Astro.glob()`으로 가져온 Markdown 파일은 다음과 같은 `MarkdownInstance` 인터페이스를 반환합니다: + +```ts +export interface MarkdownInstance> { + /* 이 파일의 YAML/TOML 프런트매터에 지정된 모든 데이터 */ + frontmatter: T; + /* 이 파일의 절대 경로 */ + file: string; + /* 이 파일의 렌더링 경로 */ + url: string | undefined; + /* 이 파일의 콘텐츠를 렌더링하는 Astro 컴포넌트 */ + Content: AstroComponentFactory; + /** (Markdown 전용) 원시 Markdown 파일 콘텐츠, 레이아웃 HTML 및 YAML/TOML 프런트매터 제외 */ + rawContent(): string; + /** (Markdown 전용) HTML로 컴파일된 Markdown 파일, 레이아웃 HTML 제외 */ + compiledContent(): string; + /* 이 파일의 h1...h6 요소의 배열을 반환하는 함수 */ + getHeadings(): Promise<{ depth: number; slug: string; text: string }[]>; + default: AstroComponentFactory; +} ``` -#### `csp.insertStyleHash()` +선택적으로 TypeScript 제네릭을 사용하여 `frontmatter` 변수에 타입을 제공할 수 있습니다. -

- -**타입:** `(hash: CspHash) => void`
- -

- -`style-src` 지시어에 새로운 해시를 추가합니다. - -```astro title="src/pages/index.astro" +```astro --- -Astro.csp?.insertStyleHash("sha512-styleHash"); +interface Frontmatter { + title: string; + description?: string; +} +const posts = await Astro.glob('../pages/post/*.md'); --- -``` - -빌드 후, 이 개별 페이지의 `` 요소는 기본 `style-src` 지시어에 지정된 해시를 추가합니다. -```html - +
    + {posts.map(post =>
  • {post.frontmatter.title}
  • )} +
``` -#### `csp.insertScriptResource()` - -

- -**타입:** `(resource: string) => void`
- -

+##### Astro 파일 -`script-src` 지시어에 사용할 새로운 유효한 소스를 삽입합니다. +Astro 파일에는 다음과 같은 인터페이스가 있습니다: -```astro title="src/pages/index.astro" ---- -Astro.csp?.insertScriptResource("https://scripts.cdn.example.com"); ---- -``` - -빌드 후, 이 개별 페이지의 `` 요소는 기본 `script-src` 지시어에 지정된 소스를 추가합니다. - -```html - +```ts +export interface AstroInstance { + /* 이 파일의 파일 경로 */ + file: string; + /* 이 파일의 URL(pages 디렉터리에 있는 경우) */ + url: string | undefined; + default: AstroComponentFactory; +} ``` -#### `csp.insertScriptHash()` +##### 기타 파일 -

- -**타입:** `(hash: CspHash) => void`
- -

+기타 파일에는 다양한 인터페이스가 있을 수 있지만 `Astro.glob()`은 인식할 수 없는 파일 형식이 정확히 무엇인지 알고 있는 경우 TypeScript 제네릭을 허용합니다. -`script-src` 지시어에 새로운 해시를 추가합니다. - -```astro title="src/pages/index.astro" +```ts --- -Astro.csp?.insertScriptHash("sha512-scriptHash"); +interface CustomDataFile { + default: Record; +} +const data = await Astro.glob('../data/**/*.js'); --- ``` - -빌드 후, 이 개별 페이지의 `` 요소는 기본 `script-src` 지시어에 지정된 해시를 추가합니다. - -```html - -``` diff --git a/src/content/docs/ko/reference/modules/astro-config.mdx b/src/content/docs/ko/reference/modules/astro-config.mdx index 6f53745418d0a..a593176289e3c 100644 --- a/src/content/docs/ko/reference/modules/astro-config.mdx +++ b/src/content/docs/ko/reference/modules/astro-config.mdx @@ -8,19 +8,16 @@ tableOfContents: maxHeadingLevel: 6 --- -import ReadMore from '~/components/ReadMore.astro'; import Since from '~/components/Since.astro';

-`astro:config` 가상 모듈은 Astro 구성의 일부 속성들을 직렬화 가능하고 타입 안전한 버전으로 노출합니다. 구성 값의 서로 다른 하위 집합에 액세스하기 위한 두 가지 하위 모듈인 [`/client`](#astroconfigclient에서-가져오기) 및 [`/server`](#astroconfigserver에서-가져오기)가 있습니다. +이 `astro:config` 가상 모듈은 완전하지는 않지만 직렬화 가능하고 타입 안전한 버전의 Astro 구성을 제공합니다. 구성 값의 서로 다른 하위 집합에 접근하기 위한 두 개의 하위 모듈 [`/client`](#astroconfigclient에서-가져오기) 및 [`/server`](#astroconfigserver에서-가져오기)가 있습니다. -모든 사용 가능한 구성 값은 `astro:config/server`에서 액세스할 수 있습니다. 하지만 클라이언트에서 실행되는 코드의 경우 `astro:config/client`에서 노출된 값만 사용할 수 있습니다. 이는 일부 데이터만 클라이언트에 제공함으로써 정보를 보호합니다. +`astro:config/server`에서 사용 가능한 모든 구성 값에 접근할 수 있습니다. 하지만 클라이언트에서 실행되는 코드의 경우, `astro:config/client`를 통해 노출된 값만 사용할 수 있습니다. 이는 일부 데이터만 클라이언트에 제공함으로써 정보를 보호합니다. ## `astro:config/client`에서 가져오기 -가상 구성 모듈의 `client` 디렉터리에서 다음 도우미를 가져옵니다. - ```js import { i18n, @@ -32,7 +29,7 @@ import { } from "astro:config/client"; ``` -클라이언트 측 코드에는 이 하위 모듈을 사용하세요: +클라이언트 측 코드에는 이 하위 모듈을 사용하세요. ```js title="src/utils.js" ins={1} ins="trailingSlash" import { trailingSlash } from "astro:config/client"; @@ -46,7 +43,7 @@ function addForwardSlash(path) { } ``` -`astro:config/client`에서 사용할 수 있는 구성 가져오기에 대해 자세히 알아보세요: +`astro:config/client`에서 사용할 수 있는 구성 가져오기에 대해 자세히 알아보세요. - [`i18n`](/ko/reference/configuration-reference/#i18n) - [`trailingSlash`](/ko/reference/configuration-reference/#trailingslash) @@ -56,11 +53,8 @@ function addForwardSlash(path) { - [`compressHTML`](/ko/reference/configuration-reference/#compresshtml) - ## `astro:config/server`에서 가져오기 -가상 구성 모듈의 `server` 디렉터리에서 다음 도우미를 가져옵니다. - ```js import { i18n, @@ -77,9 +71,9 @@ import { } from "astro:config/server"; ``` -이러한 가져오기에는 `astro:config/client`에서 사용할 수 있는 모든 항목뿐만 아니라, 클라이언트에 노출하기에 안전하지 않은 파일 시스템 구성에 대한 민감한 정보도 포함됩니다. +이러한 가져오기에는 `astro:config/client`에서 사용할 수 있는 것은 물론, 클라이언트에 노출하기에 안전하지 않은 파일 시스템 구성에 대한 민감한 정보도 포함됩니다. -서버 측 코드에는 이 하위 모듈을 사용하세요: +서버 측 코드에는 이 하위 모듈을 사용하세요. ```js title="astro.config.mjs" import { integration } from "./integration.mjs"; @@ -102,7 +96,7 @@ export default function() { hooks: { "astro:build:done": () => { let file = new URL("result.json", outDir); - // 데이터 생성 작업 + // 특정 연산으로 데이터를 생성합니다. let data = JSON.stringify([]); writeFileSync(fileURLToPath(file), data, "utf-8"); } @@ -111,7 +105,7 @@ export default function() { } ``` -`astro:config/server`에서 사용할 수 있는 구성 가져오기에 대해 자세히 알아보세요: +`astro:config/server`에서 사용할 수 있는 구성 가져오기에 대해 자세히 알아보세요. - [`i18n`](/ko/reference/configuration-reference/#i18n) - [`trailingSlash`](/ko/reference/configuration-reference/#trailingslash) @@ -126,249 +120,3 @@ export default function() { - [`publicDir`](/ko/reference/configuration-reference/#publicdir) - [`root`](/ko/reference/configuration-reference/#root) - [`compressHTML`](/ko/reference/configuration-reference/#compresshtml) - -## `astro/config`에서 가져오기 - -일반 구성 모듈에서 다음 도우미를 가져옵니다. - -```js -import { - defineConfig, - envField, - fontProviders, - getViteConfig, - mergeConfig, - passthroughImageService, - sessionDrivers, - sharpImageService, - validateConfig, -} from "astro/config"; -``` - -### `defineConfig()` - -

- -**타입:** (config: AstroUserConfig) => AstroUserConfig -

- -[지원되는 Astro 구성 파일](/ko/guides/configuring-astro/#astro-구성-파일)에서 타입 안전성을 갖춘 프로젝트를 구성합니다. - -### `envField` - -

- -**타입:** `object`
- -

- -[환경 변수를 정의](/ko/reference/configuration-reference/#envschema)할 때 지원되는 데이터 타입을 설명합니다. - -각 데이터 타입은 `context` (`"client"` 또는 `"server"`) 및 `access` (`"secret"` 또는 `"public"`)와 함께 [변수 타입](/ko/guides/environment-variables/#변수-타입)을 정의해야 합니다. 또한 `default` 값을 정의하고, 변수가 `optional`인지 여부(기본값 `false`)를 지정할 수 있으며, 일부 데이터 타입은 선택적 유효성 검사 메서드를 제공합니다. - -Astro 프로젝트에서 [타입 안전한 환경 변수를 사용하는 방법](/ko/guides/environment-variables/#타입-안전-환경-변수)에 대해 자세히 알아보세요. - -#### `envField.string()` - -

- -**타입:** `(options: StringFieldInput) => StringField` -

- -문자열 타입의 환경 변수를 정의합니다. `max`, `min`, `length`, `url`, `includes`, `startsWith`, `endsWith` 속성을 사용하여 [Zod로 문자열 유효성 검사](https://zod.dev/api#strings)를 수행할 수 있습니다. - -다음 예시는 API URL을 저장하는 환경 변수의 예상 형태를 정의합니다. - -```js title="astro.config.mjs" "envField" -import { defineConfig, envField } from "astro/config"; - -export default defineConfig({ - env: { - schema: { - API_URL: envField.string({ - context: "client", - access: "public", - optional: false, - default: "", - min: 12, - url: true, - includes: "astro", - startsWith: "https", - }), - } - } -}) -``` - -#### `envField.number()` - -

- -**타입:** `(options: NumberFieldInput) => NumberField` -

- -숫자 타입의 환경 변수를 정의합니다. `gt`, `lt`, `min`, `max`, `int` 속성을 사용하여 [Zod로 숫자 유효성 검사](https://zod.dev/api#numbers)를 수행할 수 있습니다. - -다음 예시는 API 포트를 저장하는 환경 변수의 예상 형태를 정의합니다. - -```js title="astro.config.mjs" "envField" -import { defineConfig, envField } from "astro/config"; - -export default defineConfig({ - env: { - schema: { - API_PORT: envField.number({ - context: "server", - access: "public", - optional: true, - default: 4321, - min: 2, - int: true, - }), - } - } -}) -``` - -#### `envField.boolean()` - -

- -**타입:** `(options: BooleanFieldInput) => BooleanField` -

- -불리언 타입의 환경 변수를 정의합니다. - -다음 예시는 분석 활성화 여부를 저장하는 환경 변수의 예상 형태를 정의합니다. - -```js title="astro.config.mjs" "envField" -import { defineConfig, envField } from "astro/config"; - -export default defineConfig({ - env: { - schema: { - ANALYTICS_ENABLED: envField.boolean({ - context: "client", - access: "public", - optional: true, - default: true, - }), - } - } -}) -``` - -#### `envField.enum()` - -

- -**타입:** `(options: EnumFieldInput) => EnumField` -

- -허용된 `values`를 배열로 제공하여 열거형 타입의 환경 변수를 정의합니다. - -다음 예시는 구성된 디버그 모드를 저장하는 환경 변수의 예상 형태를 정의합니다. - -```js title="astro.config.mjs" "envField" {9} -import { defineConfig, envField } from "astro/config"; - -export default defineConfig({ - env: { - schema: { - DEBUG_MODE: envField.enum({ - context: "server", - access: "public", - values: ['info', 'warnings', 'errors'], // 필수 - optional: true, - default: 'errors', - }), - } - } -}) -``` - -### `fontProviders` - -

- -**타입:** `object`
- -

- -[구성된 폰트를 가져오기](/ko/reference/configuration-reference/#fontprovider) 위해 사용되는 [내장 제공자](/ko/reference/font-provider-reference/#built-in-providers)를 설명합니다. - -### `getViteConfig()` - -

- -**타입:** (userViteConfig: ViteUserConfig, inlineAstroConfig?: AstroInlineConfig) => ViteUserConfigFn -

- -사용자 정의 Vite 구성 객체와 선택적 Astro 구성 객체를 병합하여 사용할 Vite 구성을 가져옵니다. 이는 [테스팅을 위해 Vitest를 설정](/ko/guides/testing/#vitest)할 때 유용합니다. - -### `mergeConfig()` - -[프로그래밍 방식 API 참조의 `mergeConfig()`](/ko/reference/programmatic-reference/#mergeconfig)를 확인하세요. - -### `passthroughImageService()` - -

- -**타입:** () => ImageServiceConfig -

- -no-op 이미지 서비스를 가져옵니다. 이는 어댑터가 Astro의 내장 Sharp 이미지 최적화를 지원하지 않지만 [`` 및 `` 컴포넌트를 사용](/ko/guides/images/#astro-컴포넌트의-이미지)하고 싶을 때 유용합니다. - -다음 예시는 Sharp 이미지 처리를 피하기 위해 Astro 구성 파일에서 `passthroughImageService()`를 이미지 서비스로 정의합니다. - -```js title="astro.config.mjs" "passthroughImageService" -import { defineConfig, passthroughImageService } from "astro/config"; - -export default defineConfig({ - image: { - service: passthroughImageService() - } -}); -``` - -[no-op 패스스루 서비스 구성](/ko/guides/images/#무작동-패스스루-서비스-구성)에 대해 자세히 알아보세요. - -### `sessionDrivers` - -

- -**타입:** `object`
- -

- -[세션 저장소](/ko/reference/configuration-reference/#세션-옵션)에 사용되는 [내장 드라이버](/ko/reference/session-driver-reference/#built-in-drivers)를 설명합니다. - -다음 예시는 세션을 활성화하기 위해 Redis 드라이버를 구성합니다. - -```js title="astro.config.mjs" "sessionDrivers" -import { defineConfig, sessionDrivers } from "astro/config"; - -export default defineConfig({ - session: { - driver: sessionDrivers.redis({ - url: process.env.REDIS_URL - }), - } -}) -``` - -Astro 프로젝트에서 [세션을 사용하는 방법](/ko/guides/sessions/)에 대해 자세히 알아보세요. - -### `sharpImageService()` - -

- -**타입:** (config?: SharpImageServiceConfig) => ImageServiceConfig
- -

- -Astro의 이미지 자산을 처리하는 데 사용되는 Sharp 서비스를 가져옵니다. 이는 [Sharp 구성 옵션](/ko/reference/configuration-reference/#imageservice)을 설명하는 선택적 객체를 인자로 받습니다. - -### `validateConfig()` - -[프로그래밍 방식 API 참조의 `validateConfig()`](/ko/reference/programmatic-reference/#validateconfig)를 확인하세요. From a06f9239ef7666d319ed5b81a792d1cb13e0549b Mon Sep 17 00:00:00 2001 From: Junseong Park <39112954+jsparkdev@users.noreply.github.com> Date: Fri, 27 Mar 2026 14:10:18 +0900 Subject: [PATCH 5/6] update --- .../ko/reference/configuration-reference.mdx | 77 ++++++++++++++++--- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/src/content/docs/ko/reference/configuration-reference.mdx b/src/content/docs/ko/reference/configuration-reference.mdx index 6c82636c92d9c..ce3894cd0897f 100644 --- a/src/content/docs/ko/reference/configuration-reference.mdx +++ b/src/content/docs/ko/reference/configuration-reference.mdx @@ -1501,6 +1501,13 @@ Astro의 자산 지원에 사용되는 이미지 서비스를 설정합니다. entrypoint: 'astro/assets/services/sharp', config: { limitInputPixels: false, + webp: { + effort: 6, + alphaQuality: 80, + }, + jpeg: { + mozjpeg: true, + }, }, }, }, @@ -1534,6 +1541,62 @@ Sharp 이미지 서비스에서 [이미지 크기를 조정하는 데 사용되 기본적으로 이 값은 `undefined`이며, Sharp의 기본 커널인 `lanczos3`에 매핑됩니다. +#### image.service.config.jpeg + +

+ +**타입:** `Record | undefined`
+**기본값:** `undefined`
+ +

+ +Astro의 내장 Sharp 이미지 서비스를 사용할 때 `sharp().jpeg()`에 전달되는 기본 인코더 옵션입니다. + +`mozjpeg`, `progressive`, `chromaSubsampling` 또는 기본 `quality`와 같은 옵션에 사용할 수 있습니다. +``, ``, `getImage()`에서 설정한 이미지별 `quality` 값이 여전히 우선합니다. + +#### image.service.config.webp + +

+ +**타입:** `Record | undefined`
+**기본값:** `undefined`
+ +

+ +Astro의 내장 Sharp 이미지 서비스를 사용할 때 `sharp().webp()`에 전달되는 기본 인코더 옵션입니다. + +`effort`, `alphaQuality`, `lossless`, `nearLossless` 또는 기본 `quality`와 같은 옵션에 사용할 수 있습니다. +``, ``, `getImage()`에서 설정한 이미지별 `quality` 값이 여전히 우선합니다. + +#### image.service.config.avif + +

+ +**타입:** `Record | undefined`
+**기본값:** `undefined`
+ +

+ +Astro의 내장 Sharp 이미지 서비스를 사용할 때 `sharp().avif()`에 전달되는 기본 인코더 옵션입니다. + +`effort`, `chromaSubsampling`, `bitdepth`, `lossless` 또는 기본 `quality`와 같은 옵션에 사용할 수 있습니다. +``, ``, `getImage()`에서 설정한 이미지별 `quality` 값이 여전히 우선합니다. + +#### image.service.config.png + +

+ +**타입:** `Record | undefined`
+**기본값:** `undefined`
+ +

+ +Astro의 내장 Sharp 이미지 서비스를 사용할 때 `sharp().png()`에 전달되는 기본 인코더 옵션입니다. + +`compressionLevel`, `effort`, `palette` 또는 기본 `quality`와 같은 옵션에 사용할 수 있습니다. +``, ``, `getImage()`에서 설정한 이미지별 `quality` 값이 여전히 우선합니다. + ### image.domains

@@ -1841,21 +1904,17 @@ Astro는 기본적으로 [GitHub 기반 Markdown](https://github.com/remarkjs/re

-**타입:** `boolean`
+**타입:** `boolean | Smartypants`
**기본값:** `true`

-Astro는 기본적으로 [SmartyPants 포매터](https://daringfireball.net/projects/smartypants/)를 사용합니다. 이를 비활성화하려면 `smartypants` 플래그를 `false`로 설정하세요. +[SmartyPants 포매터](https://daringfireball.net/projects/smartypants/)를 사용하여 곧은 따옴표를 둥근 따옴표로, 대시를 en/em 대시로, 세 개의 점을 줄임표로 변환할지 여부입니다. -```js -{ - markdown: { - smartypants: false, - } -} -``` +이를 비활성화하려면 `smartypants` 플래그를 `false`로 설정하세요. + +타이포그래피를 더 세밀하게 제어하려면 대신 [`retext-smartypants`에서 지원하는 속성](https://github.com/retextjs/retext-smartypants?tab=readme-ov-file#fields)이 포함된 구성 객체를 지정할 수 있습니다. ### markdown.remarkRehype From eca90bff2ddf7e3250aaf0913e5517b812b3474c Mon Sep 17 00:00:00 2001 From: Junseong Park <39112954+jsparkdev@users.noreply.github.com> Date: Wed, 8 Apr 2026 11:01:32 +0900 Subject: [PATCH 6/6] update external links --- src/content/docs/ko/guides/fonts.mdx | 8 ++++---- .../ko/guides/integrations-guide/netlify.mdx | 2 +- .../docs/ko/guides/view-transitions.mdx | 2 +- .../docs/ko/reference/adapter-reference.mdx | 2 +- .../docs/ko/reference/api-reference.mdx | 2 +- .../errors/prerender-route-conflict.mdx | 2 +- .../ko/reference/integrations-reference.mdx | 18 +++++++++--------- .../docs/ko/reference/modules/astro-assets.mdx | 4 ++-- .../docs/ko/reference/modules/astro-config.mdx | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/content/docs/ko/guides/fonts.mdx b/src/content/docs/ko/guides/fonts.mdx index 43895a39cfaa9..517508d20f5ce 100644 --- a/src/content/docs/ko/guides/fonts.mdx +++ b/src/content/docs/ko/guides/fonts.mdx @@ -11,7 +11,7 @@ import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; 이 안내서는 프로젝트에 [웹 글꼴](https://developer.mozilla.org/ko/docs/Learn_web_development/Core/Text_styling/Web_fonts)을 추가하고 컴포넌트에서 사용하는 방법을 설명합니다. -Astro는 통합되고, [완전히 사용자 정의 가능하며](/ko/reference/configuration-reference/), 타입 안정성을 갖춘 API를 통해 파일 시스템 및 다양한 글꼴 제공업체(예: Fontsource, Google)의 글꼴을 사용할 수 있는 방법을 제공합니다. +Astro는 통합되고, [완전히 사용자 정의 가능하며](/ko/reference/configuration-reference/#fonts), 타입 안정성을 갖춘 API를 통해 파일 시스템 및 다양한 글꼴 제공업체(예: Fontsource, Google)의 글꼴을 사용할 수 있는 방법을 제공합니다. 웹 글꼴은 로드 시간과 렌더링 시간 모두에서 페이지 성능에 영향을 미칠 수 있습니다. 이 API는 프리로드 링크, 최적화된 대체 글꼴, 정해진 기본값 등 자동 [웹 글꼴 최적화](https://web.dev/learn/performance/optimize-web-fonts)를 통해 사이트 성능을 유지하는 데 도움을 줍니다. [일반적인 사용 예시를 참조하세요](#예시). @@ -19,9 +19,9 @@ Astro는 통합되고, [완전히 사용자 정의 가능하며](/ko/reference/c ## 사용자 정의 글꼴 구성 -Astro 프로젝트에 사용자 정의 글꼴을 등록하는 것은 Astro 구성 파일의 [`fonts` 옵션](/ko/reference/configuration-reference/)을 통해 이루어집니다. +Astro 프로젝트에 사용자 정의 글꼴을 등록하는 것은 Astro 구성 파일의 [`fonts` 옵션](/ko/reference/configuration-reference/#fonts)을 통해 이루어집니다. -사용하려는 각 글꼴에 대해 [이름](/ko/reference/configuration-reference/), [CSS 변수](/ko/reference/configuration-reference/), 그리고 Astro 글꼴 제공업체를 지정해야 합니다. +사용하려는 각 글꼴에 대해 [이름](/ko/reference/configuration-reference/#fontname), [CSS 변수](/ko/reference/configuration-reference/#fontcssvariable), 그리고 Astro 글꼴 제공업체를 지정해야 합니다. Astro는 Adobe, Bunny, Fontshare, Fontsource, Google, Google Icons, NPM과 같은 [가장 인기 있는 글꼴 제공업체에 대한 내장 지원](/ko/reference/font-provider-reference/#built-in-providers)과 로컬 글꼴 파일 사용을 지원합니다. 또한 성능과 방문자 경험을 최적화하기 위해 [글꼴 구성을 추가로 사용자 정의할 수 있습니다](#세부적인-글꼴-구성). @@ -175,7 +175,7 @@ Astro는 Google Fonts 및 기타 오픈 소스 글꼴 사용을 간소화하는 ## 프로그래밍 방식으로 글꼴 데이터 접근 -[`fontData`](/ko/reference/modules/astro-assets/#fontdata) 객체를 사용하면 하위 수준의 글꼴 패밀리 데이터를 프로그래밍 방식으로 가져올 수 있습니다. 예를 들어, 적절한 [형식](/ko/reference/configuration-reference/) 구성과 결합하여 [satori](https://github.com/vercel/satori)를 사용하여 OpenGraph 이미지를 생성하기 위한 [API 라우트](/ko/guides/endpoints/#서버-엔드포인트-api-라우트)에서 사용할 수 있습니다: +[`fontData`](/ko/reference/modules/astro-assets/#fontdata) 객체를 사용하면 하위 수준의 글꼴 패밀리 데이터를 프로그래밍 방식으로 가져올 수 있습니다. 예를 들어, 적절한 [형식](/ko/reference/configuration-reference/#fontformats) 구성과 결합하여 [satori](https://github.com/vercel/satori)를 사용하여 OpenGraph 이미지를 생성하기 위한 [API 라우트](/ko/guides/endpoints/#서버-엔드포인트-api-라우트)에서 사용할 수 있습니다: ```tsx title="src/pages/og.png.ts" {2} "fontData[\"--font-roboto\"]" import type{ APIRoute } from "astro"; diff --git a/src/content/docs/ko/guides/integrations-guide/netlify.mdx b/src/content/docs/ko/guides/integrations-guide/netlify.mdx index 5b106ce66dfa9..bc45db64da837 100644 --- a/src/content/docs/ko/guides/integrations-guide/netlify.mdx +++ b/src/content/docs/ko/guides/integrations-guide/netlify.mdx @@ -421,7 +421,7 @@ Netlify 구성에서 사전 렌더링된 페이지에 대한 사용자 정의 이 기능이 활성화되면, Astro 기능 (예: 콘텐츠 보안 정책)에서 제공하는 경우 어댑터는 [정적 헤더를 프레임워크 API 구성 파일](https://docs.netlify.com/frameworks-api/#headers)에 저장합니다. -예를 들어, [콘텐츠 보안 정책](/ko/reference/configuration-reference/)이 활성화된 경우, `` 요소를 생성하는 대신 `staticHeaders`를 사용하여 CSP `headers`를 Netlify 구성에 추가할 수 있습니다. +예를 들어, [콘텐츠 보안 정책](/ko/reference/configuration-reference/#securitycsp)이 활성화된 경우, `` 요소를 생성하는 대신 `staticHeaders`를 사용하여 CSP `headers`를 Netlify 구성에 추가할 수 있습니다. ```js title="astro.config.mjs" {9} import { defineConfig } from 'astro/config'; diff --git a/src/content/docs/ko/guides/view-transitions.mdx b/src/content/docs/ko/guides/view-transitions.mdx index f8855c38b0fde..2381740479807 100644 --- a/src/content/docs/ko/guides/view-transitions.mdx +++ b/src/content/docs/ko/guides/view-transitions.mdx @@ -461,7 +461,7 @@ import { ClientRouter } from "astro:transitions"; 사이트 및 허용할 내용에 따라 필요한 검증의 방식이 달라집니다. -사용자 입력을 `navigate()` API와 함께 사용하는 경우, Astro의 [콘텐츠 보안 정책](/ko/reference/configuration-reference/)을 활성화하여 교차 사이트 스크립팅 (XSS) 위험으로부터 보호하는 것을 고려해 보세요. +사용자 입력을 `navigate()` API와 함께 사용하는 경우, Astro의 [콘텐츠 보안 정책](/ko/reference/configuration-reference/#securitycsp)을 활성화하여 교차 사이트 스크립팅 (XSS) 위험으로부터 보호하는 것을 고려해 보세요. ## 대체 옵션 diff --git a/src/content/docs/ko/reference/adapter-reference.mdx b/src/content/docs/ko/reference/adapter-reference.mdx index 1b33353ccf077..d21f6cf7ab0cb 100644 --- a/src/content/docs/ko/reference/adapter-reference.mdx +++ b/src/content/docs/ko/reference/adapter-reference.mdx @@ -818,7 +818,7 @@ export default function createIntegration() { } ``` -헤더의 값은 애플리케이션에서 활성화 및 사용되는 기능에 따라 변경될 수 있습니다. 예를 들어, [CSP가 활성화된 경우](/ko/reference/configuration-reference/), `` 요소가 정적 페이지에 추가되지 않습니다. 대신, 해당 `content`는 `routeToHeaders` 맵에서 사용할 수 있습니다. +헤더의 값은 애플리케이션에서 활성화 및 사용되는 기능에 따라 변경될 수 있습니다. 예를 들어, [CSP가 활성화된 경우](/ko/reference/configuration-reference/#securitycsp), `` 요소가 정적 페이지에 추가되지 않습니다. 대신, 해당 `content`는 `routeToHeaders` 맵에서 사용할 수 있습니다. ### `preserveBuildClientDir` diff --git a/src/content/docs/ko/reference/api-reference.mdx b/src/content/docs/ko/reference/api-reference.mdx index ca3095c51db43..5768ffb9c9bfc 100644 --- a/src/content/docs/ko/reference/api-reference.mdx +++ b/src/content/docs/ko/reference/api-reference.mdx @@ -1068,7 +1068,7 @@ Astro의 CSP 런타임 API는 문서가 로드할 수 있는 리소스를 제어 `.astro` 컴포넌트 내부의 `Astro` 전역 객체 또는 엔드포인트 및 미들웨어의 `APIContext` 타입을 사용하여 페이지별로 `` 요소를 사용자 정의할 수 있습니다. -리소스가 여러 번 삽입되거나 여러 소스(예: [`csp` 구성](/ko/reference/configuration-reference/)에 정의된 것과 다음 CSP 런타임 API를 사용하여 추가된 것)에서 제공되는 경우, Astro는 모든 리소스를 병합하고 중복을 제거하여 `` 요소를 생성합니다. +리소스가 여러 번 삽입되거나 여러 소스(예: [`csp` 구성](/ko/reference/configuration-reference/#securitycsp)에 정의된 것과 다음 CSP 런타임 API를 사용하여 추가된 것)에서 제공되는 경우, Astro는 모든 리소스를 병합하고 중복을 제거하여 `` 요소를 생성합니다. #### `csp.insertDirective()` diff --git a/src/content/docs/ko/reference/errors/prerender-route-conflict.mdx b/src/content/docs/ko/reference/errors/prerender-route-conflict.mdx index 0980fa697cb99..f385540d4dd8f 100644 --- a/src/content/docs/ko/reference/errors/prerender-route-conflict.mdx +++ b/src/content/docs/ko/reference/errors/prerender-route-conflict.mdx @@ -11,4 +11,4 @@ githubURL: https://github.com/withastro/astro/blob/main/packages/astro/src/core/ **더 보기:** - [라우트 우선 순위](/ko/guides/routing/#라우트-우선-순위) -- [`prerenderConflictBehavior`](/ko/reference/configuration-reference/) +- [`prerenderConflictBehavior`](/ko/reference/configuration-reference/#prerenderconflictbehavior) diff --git a/src/content/docs/ko/reference/integrations-reference.mdx b/src/content/docs/ko/reference/integrations-reference.mdx index bf58c10224d75..7775395622d8f 100644 --- a/src/content/docs/ko/reference/integrations-reference.mdx +++ b/src/content/docs/ko/reference/integrations-reference.mdx @@ -851,7 +851,7 @@ export default { } ``` -로더는 `refreshContextData` 속성에 접근하여 웹훅 본문을 가져올 수 있습니다. 자세한 내용은 [`refreshContextData`](/ko/reference/content-loader-reference/) 속성을 참조하세요. +로더는 `refreshContextData` 속성에 접근하여 웹훅 본문을 가져올 수 있습니다. 자세한 내용은 [`refreshContextData`](/ko/reference/content-loader-reference/#loadercontextrefreshcontextdata) 속성을 참조하세요. ### `astro:server:start` @@ -2665,7 +2665,7 @@ HTML 출력에 인라인으로 포함될 스크립트의 식별자와 해당 콘

-[콘텐츠 보안 정책 구성](/ko/reference/configuration-reference/)을 설명합니다. +[콘텐츠 보안 정책 구성](/ko/reference/configuration-reference/#securitycsp)을 설명합니다. ##### `SSRManifest.csp.cspDestination` @@ -2683,7 +2683,7 @@ CSP 지시어를 `meta` 요소로 삽입할지, 응답 `header`로 삽입할지, **타입:** `'SHA-256' | 'SHA-384' | 'SHA-512'`

-[설정된 해시 함수](/ko/reference/configuration-reference/)를 지정합니다. +[설정된 해시 함수](/ko/reference/configuration-reference/#securitycspalgorithm)를 지정합니다. ##### `SSRManifest.csp.scriptHashes` @@ -2692,7 +2692,7 @@ CSP 지시어를 `meta` 요소로 삽입할지, 응답 `header`로 삽입할지, **타입:** `string[]`

-프로젝트 스크립트용으로 생성된 해시 목록과 외부 스크립트용으로 [사용자가 제공한 해시](/ko/reference/configuration-reference/) 목록을 지정합니다. +프로젝트 스크립트용으로 생성된 해시 목록과 외부 스크립트용으로 [사용자가 제공한 해시](/ko/reference/configuration-reference/#securitycspscriptdirectivehashes) 목록을 지정합니다. ##### `SSRManifest.csp.scriptResources` @@ -2701,7 +2701,7 @@ CSP 지시어를 `meta` 요소로 삽입할지, 응답 `header`로 삽입할지, **타입:** `string[]`

-[설정된 스크립트 리소스](/ko/reference/configuration-reference/)와 [삽입된 스크립트 리소스](/ko/reference/api-reference/)를 결합한 유효한 소스 목록을 지정합니다. +[설정된 스크립트 리소스](/ko/reference/configuration-reference/#securitycspscriptdirectiveresources)와 [삽입된 스크립트 리소스](/ko/reference/api-reference/#cspinsertscriptresource)를 결합한 유효한 소스 목록을 지정합니다. ##### `SSRManifest.csp.isStrictDynamic` @@ -2710,7 +2710,7 @@ CSP 지시어를 `meta` 요소로 삽입할지, 응답 `header`로 삽입할지, **타입:** `boolean`

-[설정에서 동적 스크립트 삽입 지원이 활성화되었는지 여부](/ko/reference/configuration-reference/)를 결정합니다. +[설정에서 동적 스크립트 삽입 지원이 활성화되었는지 여부](/ko/reference/configuration-reference/#securitycspscriptdirectivestrictdynamic)를 결정합니다. ##### `SSRManifest.csp.styleHashes` @@ -2719,7 +2719,7 @@ CSP 지시어를 `meta` 요소로 삽입할지, 응답 `header`로 삽입할지, **타입:** `string[]`

-프로젝트 스타일용으로 생성된 해시 목록과 외부 스타일용으로 [사용자가 제공한 해시](/ko/reference/configuration-reference/) 목록을 지정합니다. +프로젝트 스타일용으로 생성된 해시 목록과 외부 스타일용으로 [사용자가 제공한 해시](/ko/reference/configuration-reference/#securitycspstyledirectivehashes) 목록을 지정합니다. ##### `SSRManifest.csp.styleResources` @@ -2728,7 +2728,7 @@ CSP 지시어를 `meta` 요소로 삽입할지, 응답 `header`로 삽입할지, **타입:** `string[]`

-[설정된 스타일 리소스](/ko/reference/configuration-reference/)와 [삽입된 스타일 리소스](/ko/reference/api-reference/#cspinsertstyleresource)를 결합한 유효한 소스 목록을 지정합니다. +[설정된 스타일 리소스](/ko/reference/configuration-reference/#securitycspstyledirectiveresources)와 [삽입된 스타일 리소스](/ko/reference/api-reference/#cspinsertstyleresource)를 결합한 유효한 소스 목록을 지정합니다. ##### `SSRManifest.csp.directives` @@ -2737,7 +2737,7 @@ CSP 지시어를 `meta` 요소로 삽입할지, 응답 `header`로 삽입할지, **타입:** `CspDirective[]`

-특정 콘텐츠 유형에 대해 [설정된 유효한 소스 목록](/ko/reference/configuration-reference/)을 지정합니다. +특정 콘텐츠 유형에 대해 [설정된 유효한 소스 목록](/ko/reference/configuration-reference/#securitycspdirectives)을 지정합니다. #### `SSRManifest.devToolbar` diff --git a/src/content/docs/ko/reference/modules/astro-assets.mdx b/src/content/docs/ko/reference/modules/astro-assets.mdx index 750e061b59a28..7358453185217 100644 --- a/src/content/docs/ko/reference/modules/astro-assets.mdx +++ b/src/content/docs/ko/reference/modules/astro-assets.mdx @@ -578,7 +578,7 @@ import { Font } from "astro:assets"; **예시 타입:** `"--font-roboto" | "--font-comic-sans" | ...`

-Astro 설정에 등록된 [`cssVariable`](/ko/reference/configuration-reference/)입니다: +Astro 설정에 등록된 [`cssVariable`](/ko/reference/configuration-reference/#fontcssvariable)입니다: ```astro title="src/components/Head.astro" "cssVariable" --- @@ -699,7 +699,7 @@ const { width, height } = await inferRemoteSize("https://example.com/cat.png");

-각 키는 [`cssVariable`](/ko/reference/configuration-reference/)이며, 값은 관련 글꼴을 설명하는 배열인 객체입니다. 각 글꼴은 해당 글꼴에 사용할 수 있는 `src` 배열과 선택적 속성인 `weight` 및 `style`을 포함하는 객체입니다: +각 키는 [`cssVariable`](/ko/reference/configuration-reference/#fontcssvariable)이며, 값은 관련 글꼴을 설명하는 배열인 객체입니다. 각 글꼴은 해당 글꼴에 사용할 수 있는 `src` 배열과 선택적 속성인 `weight` 및 `style`을 포함하는 객체입니다: ```ts import { fontData } from "astro:assets" diff --git a/src/content/docs/ko/reference/modules/astro-config.mdx b/src/content/docs/ko/reference/modules/astro-config.mdx index 5861ef79d698d..b4e4be5505201 100644 --- a/src/content/docs/ko/reference/modules/astro-config.mdx +++ b/src/content/docs/ko/reference/modules/astro-config.mdx @@ -295,7 +295,7 @@ export default defineConfig({

-[구성된 폰트를 가져오기](/ko/reference/configuration-reference/) 위해 사용되는 [내장 제공자](/ko/reference/font-provider-reference/#built-in-providers)를 설명합니다. +[구성된 폰트를 가져오기](/ko/reference/configuration-reference/#fontprovider) 위해 사용되는 [내장 제공자](/ko/reference/font-provider-reference/#built-in-providers)를 설명합니다. ### `getViteConfig()`