공개 상세 경로와 새 글 에디터 보정

This commit is contained in:
2026-05-02 10:02:50 +09:00
parent a7fcd7dce5
commit f3db10f015
20 changed files with 242 additions and 91 deletions

34
pages/post/[slug].vue Normal file
View File

@@ -0,0 +1,34 @@
<script setup>
definePageMeta({
layout: 'post'
})
const route = useRoute()
const slug = computed(() => String(route.params.slug || ''))
const { data: post } = await useFetch(() => `/api/posts/${slug.value}`)
if (!post.value) {
throw createError({
statusCode: 404,
statusMessage: '게시물을 찾을 수 없습니다.'
})
}
const postTag = computed(() => post.value.tags?.[0]?.toUpperCase() || 'POST')
</script>
<template>
<ContentRenderer>
<ProseHeaderCard>
<p class="post-detail__eyebrow text-sm uppercase text-white/70">
{{ postTag }}
</p>
<h1 class="post-detail__title mt-3 text-4xl font-semibold leading-tight">
{{ post.title }}
</h1>
</ProseHeaderCard>
<ContentMarkdownRenderer class="post-detail__content" :content="post.content" />
</ContentRenderer>
</template>