Skip to content

Commit

Permalink
Merge branch 'main' into add-neon
Browse files Browse the repository at this point in the history
  • Loading branch information
dreyfus92 authored Feb 28, 2025
2 parents 9ceefed + 90f0edc commit 20c2408
Show file tree
Hide file tree
Showing 13 changed files with 212 additions and 61 deletions.
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/cms/sanity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ i18nReady: true
import Grid from '~/components/FluidGrid.astro'
import Card from '~/components/ShowcaseCard.astro'

[Sanity](http://sanity.io) is a headless content management system that focuses on [structured content](https://www.sanity.io/structured-content-platform).
[Sanity](https://www.sanity.io) is a headless content management system that focuses on [structured content](https://www.sanity.io/structured-content-platform).

## Official Resources

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/deploy/azion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ To start building, follow these steps:

This guide provides an overview of deploying static applications.

## Enabling Local Devlopment Using Azion CLI
## Enabling Local Development Using Azion CLI

For the preview to work, you must execute the following command:

Expand Down
1 change: 1 addition & 0 deletions src/content/docs/en/guides/deploy/microsoft-azure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ The GitHub action yaml that is created for you assumes the use of node 14. This

- [Deploying an Astro Website to Azure Static Web Apps](https://www.blueboxes.co.uk/deploying-an-astro-website-to-azure-static-web-apps)
- [Deploying a Static Astro Site to Azure Static Web Apps using GitHub Actions](https://agramont.net/blog/create-static-site-astro-azure-ssg/#automate-deployment-with-github-actions)
- [Astro site deployment to Azure Static Web Apps with the CLI from GitHub Actions](https://www.eliostruyf.com/deploy-astro-azure-static-web-apps-github-cli/)
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/markdown-content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Local Markdown can be imported into `.astro` components using an `import` statem

If you have groups of related Markdown files, consider [defining them as collections](/en/guides/content-collections/). This gives you several advantages, including the ability to store Markdown files anywhere on your filesystem or remotely.

Collections use content-specfic, optimized APIs for [querying and rendering your Markdown content](#markdown-from-content-collections-queries) instead of file imports. Collections are intended for sets of data that share the same structure, such as blog posts or product items. When you define that shape in a schema, you additionally get validation, type safety, and Intellisense in your editor.
Collections use content-specific, optimized APIs for [querying and rendering your Markdown content](#markdown-from-content-collections-queries) instead of file imports. Collections are intended for sets of data that share the same structure, such as blog posts or product items. When you define that shape in a schema, you additionally get validation, type safety, and Intellisense in your editor.

<ReadMore>See more about [when to use content collections](/en/guides/content-collections/#when-to-create-a-collection) instead of file imports.</ReadMore>

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/upgrade-to/v5.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ No functionality has changed. This component has only changed its name.

#### What should I do?

Replace all occurences of the `ViewTransitions` import and component with `ClientRouter`:
Replace all occurrences of the `ViewTransitions` import and component with `ClientRouter`:

```astro title="src/layouts/MyLayout.astro" del={1,7} ins={2,8}
import { ViewTransitions } from 'astro:transitions';
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/reference/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ For example, running `astro check --minimumSeverity warning` will show errors an

#### `--preserveWatchOutput`

Specifies not to clear the ouput between checks when in watch mode.
Specifies not to clear the output between checks when in watch mode.

#### `--noSync`

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/reference/integrations-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,7 @@ For regular routes, the value will be the URL pathname where this route will be
Allows you to access the route [`params`](#params) with additional metadata. Each object contains the following properties:
* `content`: the `param` name,
* `dynamic`: wether the route is dynamic or not,
* `dynamic`: whether the route is dynamic or not,
* `spread`: whether the dynamic route uses the spread syntax or not.
For example, the following route `/pages/[blog]/[...slug].astro` will output the segments:
Expand Down Expand Up @@ -1580,7 +1580,7 @@ Allows you to access the route `params`. For example, when a project uses the fo
Allows you to access the route [`params`](#params-1) with additional metadata. Each object contains the following properties:
* `content`: the `param`,
* `dynamic`: wether the route is dynamic or not,
* `dynamic`: whether the route is dynamic or not,
* `spread`: whether the dynamic route uses the spread syntax or not.
For example, the following route `/pages/[lang]/index.astro` will output the segments `[[ { content: 'lang', dynamic: true, spread: false } ]]`.
Expand Down
8 changes: 3 additions & 5 deletions src/content/docs/ko/guides/images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ import localBirdImage from '../../images/subfolder/localBirdImage.png';
- `src/` 폴더에 μžˆλŠ” 둜컬 이미지
- 인증된 μ†ŒμŠ€μ—μ„œ κ°€μ Έμ˜€λŠ” [κ΅¬μ„±λœ 원격 이미지](#원격-이미지-승인)

`public/` 폴더에 μžˆλŠ” 이미지와 ν”„λ‘œμ νŠΈμ— νŠΉλ³„νžˆ κ΅¬μ„±λ˜μ§€ μ•Šμ€ 원격 이미지도 이미지 μ»΄ν¬λ„ŒνŠΈμ™€ ν•¨κ»˜ μ‚¬μš©ν•  수 μžˆμ§€λ§Œ μ²˜λ¦¬λ˜μ§€λŠ” μ•ŠμŠ΅λ‹ˆλ‹€.

`<Image />`λŠ” ν‘œμ‹œλœ 이미지λ₯Ό μ œμ–΄ν•˜κΈ° μœ„ν•΄ 둜컬 λ˜λŠ” 인증된 원격 μ΄λ―Έμ§€μ˜ 크기, 파일 μœ ν˜• 및 ν’ˆμ§ˆμ„ λ³€ν™˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€. κ²°κ³Ό `<img>` νƒœκ·Έμ—λŠ” `alt`, `loading` 및 `decoding` 속성이 ν¬ν•¨λ˜λ©° CLS (Cumulative Layout Shift)λ₯Ό λ°©μ§€ν•˜κΈ° μœ„ν•΄ 이미지 크기λ₯Ό μœ μΆ”ν•©λ‹ˆλ‹€.

:::note[Cumulative Layout Shiftλž€ λ¬΄μ—‡μž…λ‹ˆκΉŒ?]
Expand Down Expand Up @@ -279,7 +277,7 @@ export default defineConfig({

## Markdown 파일의 이미지

`.md` νŒŒμΌμ— ν‘œμ€€ Markdown `![alt](src)` ꡬ문을 μ‚¬μš©ν•˜μ„Έμš”. 이 ꡬ문은 Astro의 [이미지 μ„œλΉ„μŠ€ API](/ko/reference/image-service-reference/)와 ν•¨κ»˜ μž‘λ™ν•˜μ—¬ `src/`에 μ €μž₯된 둜컬 이미지λ₯Ό μ΅œμ ν™”ν•©λ‹ˆλ‹€. 원격 이미지와 `public/` 폴더에 μ €μž₯된 μ΄λ―Έμ§€λŠ” μ΅œμ ν™”λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
`.md` νŒŒμΌμ— ν‘œμ€€ Markdown `![alt](src)` ꡬ문을 μ‚¬μš©ν•˜μ„Έμš”. 이 ꡬ문은 Astro의 [이미지 μ„œλΉ„μŠ€ API](/ko/reference/image-service-reference/)와 ν•¨κ»˜ μž‘λ™ν•˜μ—¬ `src/`에 μ €μž₯된 둜컬 이미지와 원격 이미지λ₯Ό μ΅œμ ν™”ν•©λ‹ˆλ‹€. `public/` 폴더에 μ €μž₯된 μ΄λ―Έμ§€λŠ” μ ˆλŒ€ μ΅œμ ν™”λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

```md
<!-- src/pages/post-1.md -->
Expand All @@ -299,9 +297,9 @@ export default defineConfig({
![Astro](https://example.com/images/remote-image.png)
```

둜컬 μ΄λ―Έμ§€μ—λŠ” `<img>` νƒœκ·Έκ°€ μ§€μ›λ˜μ§€ μ•ŠμœΌλ©° `.md` νŒŒμΌμ—μ„œλŠ” `<Image />` 및 `<Picture />` μ»΄ν¬λ„ŒνŠΈλ₯Ό μ‚¬μš©ν•  수 μ—†μŠ΅λ‹ˆλ‹€.
HTML `<img>` νƒœκ·ΈλŠ” `public/`에 μ €μž₯된 이미지 λ˜λŠ” 원격 이미지λ₯Ό 이미지 μ΅œμ ν™”λ‚˜ 처리 없이 ν‘œμ‹œν•˜λŠ” 데 μ‚¬μš©ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ `<img>`λŠ” `src`에 μžˆλŠ” 둜컬 이미지에 λŒ€ν•΄μ„œλŠ” μ§€μ›λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

이미지 속성에 λŒ€ν•œ 더 λ§Žμ€ μ œμ–΄κ°€ ν•„μš”ν•œ 경우, [Astro의 MDX 톡합](/ko/guides/integrations-guide/mdx/)을 μ‚¬μš©ν•˜μ—¬ `.mdx` 파일 ν˜•μ‹μ— λŒ€ν•œ 지원을 μΆ”κ°€ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€. MDXλ₯Ό μ‚¬μš©ν•˜λ©΄ Markdown에 μ»΄ν¬λ„ŒνŠΈλ₯Ό μΆ”κ°€ν•  수 있으며, [MDXμ—μ„œ μ‚¬μš©ν•  수 μžˆλŠ” μΆ”κ°€ 이미지 μ˜΅μ…˜](#mdx-파일의-이미지)도 μ œκ³΅λ©λ‹ˆλ‹€.
`<Image />` 및 `<Picture />` μ»΄ν¬λ„ŒνŠΈλŠ” `.md` νŒŒμΌμ—μ„œ μ‚¬μš©ν•  수 μ—†μŠ΅λ‹ˆλ‹€. 이미지 속성을 보닀 μ„Έλ°€ν•˜κ²Œ μ œμ–΄ν•΄μ•Ό ν•˜λŠ” 경우, [Astro의 MDX 톡합](/ko/guides/integrations-guide/mdx/)을 μ‚¬μš©ν•˜μ—¬ `.mdx` 파일 ν˜•μ‹μ— λŒ€ν•œ 지원을 μΆ”κ°€ν•˜λŠ” 것을 ꢌμž₯ν•©λ‹ˆλ‹€. MDXλŠ” μ»΄ν¬λ„ŒνŠΈμ™€ Markdown ꡬ문을 κ²°ν•©ν•˜λŠ” 것을 ν¬ν•¨ν•˜μ—¬ [MDX의 이미지 μ˜΅μ…˜](#mdx-파일의-이미지)을 μΆ”κ°€λ‘œ μ‚¬μš©ν•  수 μžˆλ„λ‘ ν•©λ‹ˆλ‹€.

## MDX 파일의 이미지

Expand Down
8 changes: 6 additions & 2 deletions src/content/docs/ko/guides/integrations-guide/vercel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ 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)을 κ΅¬ν˜„ν•˜λ €λ©΄ bypass 토큰을 μƒμ„±ν•˜κ³  이λ₯Ό μΊμ‹±μ—μ„œ μ œμ™Έν•  κ²½λ‘œμ™€ ν•¨κ»˜ `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';

Expand All @@ -285,7 +285,11 @@ export default defineConfig({
// μ—¬λŸ¬λΆ„μ΄ μƒμ„±ν•˜λŠ” λ¬΄μž‘μœ„ λΉ„λ°€ λ¬Έμžμ—΄μž…λ‹ˆλ‹€.
bypassToken: '005556d774a8',
// 항상 μ΅œμ‹  μƒνƒœλ‘œ μ œκ³΅λ˜λŠ” κ²½λ‘œμž…λ‹ˆλ‹€.
exclude: [ "/api/invalidate", "/posts/[...slug]" ]
exclude: [
'/preview',
'/auth/[page]',
/^\/api\/.+/ // `@astrojs/[email protected]`λΆ€ν„° μ •κ·œ ν‘œν˜„μ‹μ΄ μ§€μ›λ©λ‹ˆλ‹€.
]
},
}),
});
Expand Down
8 changes: 8 additions & 0 deletions src/content/docs/ko/reference/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,14 @@ astro --config config/astro.config.mjs dev
ν”„λ‘œλ•μ…˜ ν™˜κ²½μ—μ„œ 개발 μ„œλ²„ 및 미리보기 μ„œλ²„λ₯Ό λ…ΈμΆœν•˜κΈ° μœ„ν•΄ `--host` ν”Œλž˜κ·Έλ₯Ό μ‚¬μš©ν•˜μ§€ λ§ˆμ„Έμš”. μ„œλ²„λŠ” μ‚¬μ΄νŠΈλ₯Ό κ°œλ°œν•˜λŠ” λ™μ•ˆμ—λ§Œ 둜컬 μ‚¬μš©μ„ μœ„ν•΄ μ„€κ³„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
:::

### `--allowed-hosts`

<p><Since v="5.4.0" /></p>

`dev` λ˜λŠ” `preview` λͺ¨λ“œμ—μ„œ Astroκ°€ 응닡할 수 μžˆλŠ” 호슀트 이름을 μ§€μ •ν•©λ‹ˆλ‹€. μ‰Όν‘œλ‘œ κ΅¬λΆ„λœ 호슀트 이름 λͺ©λ‘μ΄λ‚˜ λͺ¨λ“  호슀트 이름을 ν—ˆμš©ν•˜λŠ” `true`λ₯Ό 전달할 수 μžˆμŠ΅λ‹ˆλ‹€.

호슀트 이름 ν—ˆμš©μ˜ λ³΄μ•ˆ κ΄€λ ¨ 사항을 ν¬ν•¨ν•œ μžμ„Έν•œ λ‚΄μš©μ€ [Vite의 `allowedHosts` κΈ°λŠ₯](https://ko.vite.dev/config/server-options.html#server-allowedhosts)을 μ°Έμ‘°ν•˜μ„Έμš”.

### `--verbose`

문제λ₯Ό 디버깅할 λ•Œ μœ μš©ν•œ μžμ„Έν•œ λ‘œκΉ…μ„ ν™œμ„±ν™”ν•©λ‹ˆλ‹€.
Expand Down
102 changes: 59 additions & 43 deletions src/content/docs/ko/reference/experimental-flags/responsive-images.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,66 @@ import Since from '~/components/Since.astro'
}
```

이 ν”Œλž˜κ·Έκ°€ ν™œμ„±ν™”λ˜λ©΄ λͺ¨λ“  `<Image />` λ˜λŠ” `<Picture />` μ»΄ν¬λ„ŒνŠΈμ— `layout` prop을 μ „λ‹¬ν•˜μ—¬ λ°˜μ‘ν˜• 이미지λ₯Ό 생성할 수 μžˆμŠ΅λ‹ˆλ‹€.
이 ν”Œλž˜κ·Έλ₯Ό ν™œμ„±ν™”ν•˜λ©΄ Astroμ—μ„œ μ²˜λ¦¬ν•˜κ³  μ΅œμ ν™”ν•œ λͺ¨λ“  μ΄λ―Έμ§€μ˜ κΈ°λ³Έ λ™μž‘μ„ μ œμ–΄ν•˜κΈ° μœ„ν•œ 좔가적인 [`이미지` ꡬ성 μ„€μ •](#λ°˜μ‘ν˜•-이미지-ꡬ성-μ„€μ •)에 μ•‘μ„ΈμŠ€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ ˆμ΄μ•„μ›ƒμ΄ μ„€μ •λ˜λ©΄, μ΄λ―Έμ§€λŠ” μ΄λ―Έμ§€μ˜ 크기와 λ ˆμ΄μ•„μ›ƒ νƒ€μž…μ„ 기반으둜 μžλ™ μƒμ„±λœ `srcset`κ³Ό `sizes` 속성을 κ°–κ²Œ λ©λ‹ˆλ‹€. `responsive`와 `full-width` λ ˆμ΄μ•„μ›ƒμ„ 가진 이미지듀은 μ»¨ν…Œμ΄λ„ˆμ— 따라 크기가 μ‘°μ •λ˜λ„λ‘ μŠ€νƒ€μΌμ΄ μ μš©λ©λ‹ˆλ‹€.
- [Markdown의 `![]()` ꡬ문](/ko/guides/images/#markdown-파일의-이미지)을 μ‚¬μš©ν•˜λŠ” 둜컬 및 원격 이미지
- [`<Image />`](/ko/guides/images/#image--μ»΄ν¬λ„ŒνŠΈλ₯Ό-μ‚¬μš©ν•˜μ—¬-μ΅œμ ν™”λœ-이미지-ν‘œμ‹œ) 및 [`<Picture />`](/ko/guides/images/#picture--μ»΄ν¬λ„ŒνŠΈλ₯Ό-μ‚¬μš©ν•΄-λ°˜μ‘ν˜•-이미지-λ§Œλ“€κΈ°) μ»΄ν¬λ„ŒνŠΈ

λ˜ν•œ Astro의 이미지 μ»΄ν¬λ„ŒνŠΈλŠ” μ΄λ―Έμ§€λ³„λ‘œ μ΄λŸ¬ν•œ 기본값을 μž¬μ •μ˜ν•˜κΈ° μœ„ν•΄ [λ°˜μ‘ν˜• 이미지 props](#λ°˜μ‘ν˜•-이미지-속성)λ₯Ό 받을 수 μžˆμŠ΅λ‹ˆλ‹€.

`public/` ν΄λ”μ˜ μ΄λ―Έμ§€λŠ” μ ˆλŒ€ μ΅œμ ν™”λ˜μ§€ μ•ŠμœΌλ©°, λ°˜μ‘ν˜• μ΄λ―Έμ§€λŠ” μ§€μ›λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

## λ°˜μ‘ν˜• 이미지 ꡬ성 μ„€μ •

ν”„λ‘œμ νŠΈ μ „μ²΄μ—μ„œ λ°˜μ‘ν˜• 이미지λ₯Ό ν™œμ„±ν™”ν•˜λ €λ©΄ [`image.experimentalLayout`](/ko/reference/configuration-reference/#imageexperimentallayout)을 κΈ°λ³Έκ°’ (`responsive`, `fixed` λ˜λŠ” `full-width`)으둜 μ„€μ •ν•˜μ„Έμš”.

이 값이 κ΅¬μ„±λ˜μ§€ μ•Šμ€ κ²½μš°μ—λ„ `<Image />` λ˜λŠ” `<Picture />` μ»΄ν¬λ„ŒνŠΈμ— `layout` prop을 μ „λ‹¬ν•˜μ—¬ λ°˜μ‘ν˜• 이미지λ₯Ό λ§Œλ“€ 수 μžˆμŠ΅λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ Markdown μ΄λ―Έμ§€λŠ” λ°˜μ‘ν˜•μ΄ λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

기본적으둜 처리된 λͺ¨λ“  이미지에 μ μš©λ˜λŠ” [`image.experimentalObjectFit`](/ko/reference/configuration-reference/#imageexperimentalobjectfit) 및 [`image.experimentalObjectPosition`](/ko/reference/configuration-reference/#imageexperimentalobjectposition)을 μ„ νƒμ μœΌλ‘œ ꡬ성할 수 μžˆμŠ΅λ‹ˆλ‹€.

μ΄λŸ¬ν•œ 각 섀정은 prop을 μ‚¬μš©ν•˜μ—¬ κ°œλ³„ `<Image />` λ˜λŠ” `<Picture />` μ»΄ν¬λ„ŒνŠΈμ—μ„œ μž¬μ •μ˜ν•  수 μžˆμ§€λ§Œ, λͺ¨λ“  Markdown μ΄λ―Έμ§€λŠ” 항상 κΈ°λ³Έ 섀정을 μ‚¬μš©ν•©λ‹ˆλ‹€.

```js title="astro.config.mjs"
{
image: {
// λͺ¨λ“  Markdown 이미지에 μ‚¬μš©λ˜λ©°, μ΄λ―Έμ§€λ³„λ‘œ ꡬ성할 수 μ—†μŠ΅λ‹ˆλ‹€.
// prop으둜 μž¬μ •μ˜λ˜μ§€ μ•ŠλŠ” ν•œ λͺ¨λ“  `<Image />` 및 `<Picture />` μ»΄ν¬λ„ŒνŠΈμ— μ‚¬μš©λ©λ‹ˆλ‹€.
experimentalLayout: 'responsive',
},
experimental: {
responsiveImages: true,
},
}
```

## λ°˜μ‘ν˜• 이미지 속성

λ°˜μ‘ν˜• 이미지가 ν™œμ„±ν™”λ˜μ—ˆμ„ λ•Œ `<Image />` 및 `<Picture />` μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš©ν•  수 μžˆλŠ” μΆ”κ°€ μ†μ„±λ“€μž…λ‹ˆλ‹€:

- `layout`: μ΄λ―Έμ§€μ˜ λ ˆμ΄μ•„μ›ƒ νƒ€μž…μž…λ‹ˆλ‹€. `responsive`, `fixed`, `full-width` λ˜λŠ” `none`이 될 수 μžˆμŠ΅λ‹ˆλ‹€. 기본값은 [`image.experimentalLayout`](/ko/reference/configuration-reference/#imageexperimentallayout)의 κ°’μž…λ‹ˆλ‹€.
- `fit`: μ’…νš‘λΉ„κ°€ 변경될 λ•Œ 이미지λ₯Ό μ–΄λ–»κ²Œ 자λ₯Όμ§€ μ •μ˜ν•©λ‹ˆλ‹€. CSS `object-fit`의 κ°’λ“€κ³Ό μΌμΉ˜ν•©λ‹ˆλ‹€. 기본값은 `cover`이며, [`image.experimentalObjectFit`](/ko/reference/configuration-reference/#imageexperimentalobjectfit)이 μ„€μ •λœ 경우 ν•΄λ‹Ή 값이 μ‚¬μš©λ©λ‹ˆλ‹€.
- `position`: μ’…νš‘λΉ„κ°€ 변경될 λ•Œ 이미지 자λ₯΄κΈ° μœ„μΉ˜λ₯Ό μ •μ˜ν•©λ‹ˆλ‹€. CSS `object-position`의 κ°’λ“€κ³Ό μΌμΉ˜ν•©λ‹ˆλ‹€. 기본값은 `center`이며, [`image.experimentalObjectPosition`](/ko/reference/configuration-reference/#imageexperimentalobjectposition)이 μ„€μ •λœ 경우 ν•΄λ‹Ή 값이 μ‚¬μš©λ©λ‹ˆλ‹€.
- `priority`: μ„€μ •λœ 경우, 이미지λ₯Ό μ¦‰μ‹œ λ‘œλ“œν•©λ‹ˆλ‹€. 그렇지 μ•ŠμœΌλ©΄ μ΄λ―Έμ§€λŠ” 지연 λ‘œλ“œλ©λ‹ˆλ‹€. 첫 ν™”λ©΄μ—μ„œ κ°€μž₯ 큰 이미지에 이 속성을 μ‚¬μš©ν•˜μ„Έμš”. 기본값은 `false`μž…λ‹ˆλ‹€.

`widths`와 `sizes` 속성은 μ΄λ―Έμ§€μ˜ 크기와 λ ˆμ΄μ•„μ›ƒ νƒ€μž…μ„ 기반으둜 μžλ™ μƒμ„±λ˜λ©°, λŒ€λΆ€λΆ„μ˜ 경우 μˆ˜λ™μœΌλ‘œ μ„€μ •ν•  ν•„μš”κ°€ μ—†μŠ΅λ‹ˆλ‹€. `responsive`와 `full-width` 이미지에 λŒ€ν•΄ μƒμ„±λœ `sizes` 속성은 λ·°ν¬νŠΈκ°€ 이미지 λ„ˆλΉ„λ³΄λ‹€ μž‘μ„ λ•Œ 이미지가 ν™”λ©΄ 전체 λ„ˆλΉ„μ— κ°€κΉκ²Œ ν‘œμ‹œλœλ‹€λŠ” 가정을 기반으둜 ν•©λ‹ˆλ‹€. λ§Œμ•½ 이것이 μƒλ‹Ήνžˆ λ‹€λ₯Έ 경우(예: μž‘μ€ ν™”λ©΄μ—μ„œ 닀쀑 μ—΄ λ ˆμ΄μ•„μ›ƒμΈ 경우) μ΅œμƒμ˜ κ²°κ³Όλ₯Ό μœ„ν•΄ `sizes` 속성을 μˆ˜λ™μœΌλ‘œ μ‘°μ •ν•΄μ•Ό ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

`densities` 속성은 λ°˜μ‘ν˜• 이미지와 ν˜Έν™˜λ˜μ§€ μ•ŠμœΌλ©° μ„€μ •ν•˜λ”λΌλ„ λ¬΄μ‹œλ©λ‹ˆλ‹€.

예λ₯Ό λ“€μ–΄ `responsive`λ₯Ό κΈ°λ³Έ λ ˆμ΄μ•„μ›ƒμœΌλ‘œ μ„€μ •ν•œ 경우, κ°œλ³„ μ΄λ―Έμ§€μ˜ `layout` 속성을 μž¬μ •μ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

```astro
---
import { Image } from 'astro:assets';
import myImage from '../assets/my_image.png';
---
<Image src={myImage} alt="λ°˜μ‘ν˜• λ ˆμ΄μ•„μ›ƒμ„ μ‚¬μš©ν•©λ‹ˆλ‹€." width={800} height={600} />
<Image src={myImage} alt="전체 λ„ˆλΉ„ λ ˆμ΄μ•„μ›ƒμ„ μ‚¬μš©ν•©λ‹ˆλ‹€." layout="full-width" />
<Image src={myImage} alt="λ°˜μ‘ν˜• 이미지λ₯Ό λΉ„ν™œμ„±ν™”ν•©λ‹ˆλ‹€." layout="none" />
```

## λ°˜μ‘ν˜• 이미지 HTML 생성 κ²°κ³Ό

λ ˆμ΄μ•„μ›ƒμ΄ 기본적으둜 λ˜λŠ” κ°œλ³„ μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ„€μ •λ˜λ©΄, μ΄λ―Έμ§€λŠ” 크기와 λ ˆμ΄μ•„μ›ƒ μœ ν˜•μ— 따라 μžλ™μœΌλ‘œ μƒμ„±λœ `srcset` 및 `sizes` 속성을 κ°–κ²Œ λ©λ‹ˆλ‹€. `responsive` 및 `full-width` λ ˆμ΄μ•„μ›ƒμ„ 가진 μ΄λ―Έμ§€λŠ” μ»¨ν…Œμ΄λ„ˆμ— 따라 크기가 μ‘°μ •λ˜λ„λ‘ μŠ€νƒ€μΌμ΄ μ μš©λ©λ‹ˆλ‹€.

```astro title=MyComponent.astro
---
Expand Down Expand Up @@ -83,45 +140,4 @@ import myImage from '../assets/my_image.png';
}
```

## λ°˜μ‘ν˜• 이미지 속성

λ°˜μ‘ν˜• 이미지가 ν™œμ„±ν™”λ˜μ—ˆμ„ λ•Œ `<Image />` 및 `<Picture />` μ»΄ν¬λ„ŒνŠΈμ—μ„œ μ‚¬μš©ν•  수 μžˆλŠ” μΆ”κ°€ μ†μ„±λ“€μž…λ‹ˆλ‹€:

- `layout`: μ΄λ―Έμ§€μ˜ λ ˆμ΄μ•„μ›ƒ νƒ€μž…μž…λ‹ˆλ‹€. `responsive`, `fixed`, `full-width` λ˜λŠ” `none`이 될 수 μžˆμŠ΅λ‹ˆλ‹€. 기본값은 [`image.experimentalLayout`](/ko/reference/configuration-reference/#imageexperimentallayout)의 κ°’μž…λ‹ˆλ‹€.
- `fit`: μ’…νš‘λΉ„κ°€ 변경될 λ•Œ 이미지λ₯Ό μ–΄λ–»κ²Œ 자λ₯Όμ§€ μ •μ˜ν•©λ‹ˆλ‹€. CSS `object-fit`의 κ°’λ“€κ³Ό μΌμΉ˜ν•©λ‹ˆλ‹€. 기본값은 `cover`이며, [`image.experimentalObjectFit`](/ko/reference/configuration-reference/#imageexperimentalobjectfit)이 μ„€μ •λœ 경우 ν•΄λ‹Ή 값이 μ‚¬μš©λ©λ‹ˆλ‹€.
- `position`: μ’…νš‘λΉ„κ°€ 변경될 λ•Œ 이미지 자λ₯΄κΈ° μœ„μΉ˜λ₯Ό μ •μ˜ν•©λ‹ˆλ‹€. CSS `object-position`의 κ°’λ“€κ³Ό μΌμΉ˜ν•©λ‹ˆλ‹€. 기본값은 `center`이며, [`image.experimentalObjectPosition`](/ko/reference/configuration-reference/#imageexperimentalobjectposition)이 μ„€μ •λœ 경우 ν•΄λ‹Ή 값이 μ‚¬μš©λ©λ‹ˆλ‹€.
- `priority`: μ„€μ •λœ 경우, 이미지λ₯Ό μ¦‰μ‹œ λ‘œλ“œν•©λ‹ˆλ‹€. 그렇지 μ•ŠμœΌλ©΄ μ΄λ―Έμ§€λŠ” 지연 λ‘œλ“œλ©λ‹ˆλ‹€. 첫 ν™”λ©΄μ—μ„œ κ°€μž₯ 큰 이미지에 이 속성을 μ‚¬μš©ν•˜μ„Έμš”. 기본값은 `false`μž…λ‹ˆλ‹€.

`widths`와 `sizes` 속성은 μ΄λ―Έμ§€μ˜ 크기와 λ ˆμ΄μ•„μ›ƒ νƒ€μž…μ„ 기반으둜 μžλ™ μƒμ„±λ˜λ©°, λŒ€λΆ€λΆ„μ˜ 경우 μˆ˜λ™μœΌλ‘œ μ„€μ •ν•  ν•„μš”κ°€ μ—†μŠ΅λ‹ˆλ‹€. `responsive`와 `full-width` 이미지에 λŒ€ν•΄ μƒμ„±λœ `sizes` 속성은 λ·°ν¬νŠΈκ°€ 이미지 λ„ˆλΉ„λ³΄λ‹€ μž‘μ„ λ•Œ 이미지가 ν™”λ©΄ 전체 λ„ˆλΉ„μ— κ°€κΉκ²Œ ν‘œμ‹œλœλ‹€λŠ” 가정을 기반으둜 ν•©λ‹ˆλ‹€. λ§Œμ•½ 이것이 μƒλ‹Ήνžˆ λ‹€λ₯Έ 경우(예: μž‘μ€ ν™”λ©΄μ—μ„œ 닀쀑 μ—΄ λ ˆμ΄μ•„μ›ƒμΈ 경우) μ΅œμƒμ˜ κ²°κ³Όλ₯Ό μœ„ν•΄ `sizes` 속성을 μˆ˜λ™μœΌλ‘œ μ‘°μ •ν•΄μ•Ό ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

`densities` 속성은 λ°˜μ‘ν˜• 이미지와 ν˜Έν™˜λ˜μ§€ μ•ŠμœΌλ©° μ„€μ •ν•˜λ”λΌλ„ λ¬΄μ‹œλ©λ‹ˆλ‹€.

## λ°˜μ‘ν˜• 이미지 ꡬ성 μ„€μ •

[`image.experimentalLayout`](/ko/reference/configuration-reference/#imageexperimentallayout)을 κΈ°λ³Έκ°’μœΌλ‘œ μ„€μ •ν•˜μ—¬ λͺ¨λ“  `<Image />` 및 `<Picture />` μ»΄ν¬λ„ŒνŠΈμ— λŒ€ν•΄ λ°˜μ‘ν˜• 이미지λ₯Ό ν™œμ„±ν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 이 섀정은 각 μ»΄ν¬λ„ŒνŠΈμ˜ `layout` prop으둜 μž¬μ •μ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

```js title="astro.config.mjs"
{
image: {
// μž¬μ •μ˜λ˜μ§€ μ•ŠλŠ” ν•œ λͺ¨λ“  `<Image />` 및 `<Picture />` μ»΄ν¬λ„ŒνŠΈμ— μ‚¬μš©λ©λ‹ˆλ‹€
experimentalLayout: 'responsive',
},
experimental: {
responsiveImages: true,
},
}
```

`responsive`λ₯Ό κΈ°λ³Έ λ ˆμ΄μ•„μ›ƒμœΌλ‘œ μ„€μ •ν•œ 경우, κ°œλ³„ μ΄λ―Έμ§€μ˜ `layout` 속성을 μž¬μ •μ˜ν•  수 μžˆμŠ΅λ‹ˆλ‹€:

```astro
---
import { Image } from 'astro:assets';
import myImage from '../assets/my_image.png';
---
<Image src={myImage} alt="This will use responsive layout" width={800} height={600} />
<Image src={myImage} alt="This will use full-width layout" layout="full-width" />
<Image src={myImage} alt="This will disable responsive images" layout="none" />
```

전체 κ°œμš”λ₯Ό ν™•μΈν•˜κ³  이 μ‹€ν—˜μ  API에 λŒ€ν•œ ν”Όλ“œλ°±μ„ μ œκ³΅ν•˜λ €λ©΄, [λ°˜μ‘ν˜• 이미지 RFC](https://github.com/withastro/roadmap/blob/responsive-images/proposals/0053-responsive-images.md)λ₯Ό μ°Έμ‘°ν•˜μ„Έμš”.
Loading

0 comments on commit 20c2408

Please sign in to comment.