105 lines
3.1 KiB
JavaScript
105 lines
3.1 KiB
JavaScript
import { pageSchema, postSchema, tagSchema } from './content-schema'
|
|
|
|
const now = '2026-04-29T00:00:00.000Z'
|
|
|
|
const samplePosts = [
|
|
{
|
|
id: '11111111-1111-4111-8111-111111111111',
|
|
title: 'sori.studio를 직접 만들기 시작하며',
|
|
slug: 'hello-sori-studio',
|
|
content: '개인 블로그와 포털 역할을 한 공간에 담기 위한 첫 글입니다.',
|
|
excerpt: '블로그와 포털의 경계에 있는 개인 공간을 직접 구축하기 위한 첫 기록입니다.',
|
|
featuredImage: null,
|
|
status: 'published',
|
|
publishedAt: now,
|
|
createdAt: now,
|
|
updatedAt: now,
|
|
tags: ['note']
|
|
},
|
|
{
|
|
id: '22222222-2222-4222-8222-222222222222',
|
|
title: '글쓰기 도구는 왜 직접 만들게 되는가',
|
|
slug: 'custom-writing-tool',
|
|
content: '기존 도구를 거치며 남은 취향의 빈칸을 직접 채우는 과정입니다.',
|
|
excerpt: '네이버 블로그, 티스토리, 워드프레스, Ghost를 거쳐 남은 취향의 빈칸을 정리합니다.',
|
|
featuredImage: null,
|
|
status: 'published',
|
|
publishedAt: now,
|
|
createdAt: now,
|
|
updatedAt: now,
|
|
tags: ['dev']
|
|
}
|
|
]
|
|
|
|
const samplePages = [
|
|
{
|
|
id: '33333333-3333-4333-8333-333333333333',
|
|
title: 'About',
|
|
slug: 'about',
|
|
content: 'sori.studio 소개 페이지입니다.',
|
|
renderMode: 'markdown',
|
|
featuredImage: null,
|
|
createdAt: now,
|
|
updatedAt: now
|
|
}
|
|
]
|
|
|
|
const sampleTags = [
|
|
{
|
|
id: '44444444-4444-4444-8444-444444444444',
|
|
name: 'NOTE',
|
|
slug: 'note',
|
|
description: '생각과 기록을 모아두는 태그입니다.',
|
|
sortOrder: 10,
|
|
color: '#f97316'
|
|
},
|
|
{
|
|
id: '55555555-5555-4555-8555-555555555555',
|
|
name: 'DEV',
|
|
slug: 'dev',
|
|
description: '개발과 제작 과정을 기록하는 태그입니다.',
|
|
sortOrder: 20,
|
|
color: '#06b6d4'
|
|
}
|
|
]
|
|
|
|
/**
|
|
* 샘플 게시물 목록 조회
|
|
* @returns {Array<import('zod').infer<typeof postSchema>>} 샘플 게시물 목록
|
|
*/
|
|
export const getSamplePosts = () => samplePosts.map((post) => postSchema.parse(post))
|
|
|
|
/**
|
|
* 슬러그로 샘플 게시물 조회
|
|
* @param {string} slug - 게시물 슬러그
|
|
* @returns {import('zod').infer<typeof postSchema> | null} 샘플 게시물
|
|
*/
|
|
export const getSamplePostBySlug = (slug) => {
|
|
const post = samplePosts.find((item) => item.slug === slug)
|
|
|
|
return post ? postSchema.parse(post) : null
|
|
}
|
|
|
|
/**
|
|
* 샘플 고정 페이지 목록 조회
|
|
* @returns {Array<import('zod').infer<typeof pageSchema>>} 샘플 페이지 목록
|
|
*/
|
|
export const getSamplePages = () => samplePages.map((page) => pageSchema.parse(page))
|
|
|
|
/**
|
|
* 슬러그로 샘플 고정 페이지 조회
|
|
* @param {string} slug - 페이지 슬러그
|
|
* @returns {import('zod').infer<typeof pageSchema> | null} 샘플 페이지
|
|
*/
|
|
export const getSamplePageBySlug = (slug) => {
|
|
const page = samplePages.find((item) => item.slug === slug)
|
|
|
|
return page ? pageSchema.parse(page) : null
|
|
}
|
|
|
|
/**
|
|
* 샘플 태그 목록 조회
|
|
* @returns {Array<import('zod').infer<typeof tagSchema>>} 샘플 태그 목록
|
|
*/
|
|
export const getSampleTags = () => sampleTags.map((tag) => tagSchema.parse(tag))
|