Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions src/content/docs/ko/config-reference/overrides.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
i18nReady: true
title: 재정의
description: StudioCMSOptions 재정의 참조 페이지
sidebar:
order: 2
---

import ReadMore from '~/components/ReadMore.astro';

StudioCMS 통합 구성 옵션 스키마 참조

```ts twoslash title="studiocms.config.mjs"
import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
overrides: {
CustomImageOverride: 'src/components/CustomImage.astro',
FormattedDateOverride: 'src/components/FormattedDate.astro',
},
});
```

## `CustomImageOverride`

`CustomImageOverride`는 사용자 정의 이미지 컴포넌트의 경로를 결정하는 데 사용되는 문자열입니다.

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

### 사용법

```ts twoslash {3} title="studiocms.config.mjs"
import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
overrides: {
CustomImageOverride: 'src/components/CustomImage.astro',
},
})
```

## `FormattedDateOverride`

`FormattedDateOverride`는 사용자 정의 날짜 컴포넌트의 경로를 결정하는 데 사용되는 문자열입니다.

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

### 사용법

```ts twoslash {3} title="studiocms.config.mjs"
import { defineStudioCMSConfig } from 'studiocms/config';
// ---cut---
export default defineStudioCMSConfig({
overrides: {
FormattedDateOverride: 'src/components/FormattedDate.astro',
},
})
```

### 기본 컴포넌트

```astro title="FormattedDate.astro"
---
import config from 'studiocms:config';

interface Props {
date: Date;
}

const datetime = Astro.props.date.toISOString();
const formattedDate = Astro.props.date.toLocaleDateString(config.dateLocale, config.dateTimeFormat);
---

<time {datetime}>{formattedDate}</time>
```
Comment thread
Adammatthiesen marked this conversation as resolved.
Loading