고정 페이지 HTML 문서 모드 추가 v1.5.1
This commit is contained in:
@@ -4,9 +4,15 @@ import { normalizeMarkdownContent } from '../../lib/markdown-content-normalizer.
|
||||
export const adminPageInputSchema = z.object({
|
||||
title: z.string().trim().min(1),
|
||||
slug: z.string().trim().min(1).regex(/^[a-z0-9가-힣]+(?:-[a-z0-9가-힣]+)*$/),
|
||||
content: z.preprocess(normalizeMarkdownContent, z.string()).default(''),
|
||||
renderMode: z.enum(['markdown', 'html_document']).default('markdown'),
|
||||
content: z.string().default(''),
|
||||
featuredImage: z.string().trim().nullable().default(null)
|
||||
})
|
||||
}).transform((input) => ({
|
||||
...input,
|
||||
content: input.renderMode === 'html_document'
|
||||
? input.content
|
||||
: normalizeMarkdownContent(input.content)
|
||||
}))
|
||||
|
||||
/**
|
||||
* 관리자 페이지 입력값 정리
|
||||
|
||||
@@ -28,6 +28,7 @@ export const pageSchema = z.object({
|
||||
title: z.string().min(1),
|
||||
slug: z.string().min(1),
|
||||
content: z.string(),
|
||||
renderMode: z.enum(['markdown', 'html_document']).default('markdown'),
|
||||
featuredImage: z.string().nullable().default(null),
|
||||
createdAt: z.string(),
|
||||
updatedAt: z.string()
|
||||
|
||||
@@ -37,6 +37,7 @@ const samplePages = [
|
||||
title: 'About',
|
||||
slug: 'about',
|
||||
content: 'sori.studio 소개 페이지입니다.',
|
||||
renderMode: 'markdown',
|
||||
featuredImage: null,
|
||||
createdAt: now,
|
||||
updatedAt: now
|
||||
|
||||
Reference in New Issue
Block a user