게시물 SEO 설정 추가
This commit is contained in:
@@ -21,6 +21,10 @@ const mapPostRow = (row) => ({
|
||||
content: row.content,
|
||||
excerpt: row.excerpt,
|
||||
featuredImage: row.featured_image,
|
||||
seoTitle: row.seo_title || '',
|
||||
seoDescription: row.seo_description || '',
|
||||
canonicalUrl: row.canonical_url || '',
|
||||
noindex: Boolean(row.noindex),
|
||||
status: row.status,
|
||||
publishedAt: row.published_at ? row.published_at.toISOString() : null,
|
||||
createdAt: row.created_at.toISOString(),
|
||||
@@ -241,6 +245,10 @@ export const createAdminPost = async (input) => {
|
||||
content,
|
||||
excerpt,
|
||||
featured_image,
|
||||
seo_title,
|
||||
seo_description,
|
||||
canonical_url,
|
||||
noindex,
|
||||
status,
|
||||
published_at
|
||||
)
|
||||
@@ -250,6 +258,10 @@ export const createAdminPost = async (input) => {
|
||||
${input.content},
|
||||
${input.excerpt},
|
||||
${input.featuredImage},
|
||||
${input.seoTitle},
|
||||
${input.seoDescription},
|
||||
${input.canonicalUrl},
|
||||
${input.noindex},
|
||||
${input.status},
|
||||
${input.publishedAt}
|
||||
)
|
||||
@@ -286,6 +298,10 @@ export const updateAdminPost = async (id, input) => {
|
||||
content = ${input.content},
|
||||
excerpt = ${input.excerpt},
|
||||
featured_image = ${input.featuredImage},
|
||||
seo_title = ${input.seoTitle},
|
||||
seo_description = ${input.seoDescription},
|
||||
canonical_url = ${input.canonicalUrl},
|
||||
noindex = ${input.noindex},
|
||||
status = ${input.status},
|
||||
published_at = ${input.publishedAt},
|
||||
updated_at = now()
|
||||
|
||||
@@ -7,6 +7,10 @@ export const adminPostInputSchema = z.object({
|
||||
content: z.string().default(''),
|
||||
excerpt: z.string().default(''),
|
||||
featuredImage: z.string().trim().nullable().default(null),
|
||||
seoTitle: z.string().trim().max(80).default(''),
|
||||
seoDescription: z.string().trim().max(180).default(''),
|
||||
canonicalUrl: z.string().trim().url().or(z.literal('')).default(''),
|
||||
noindex: z.boolean().default(false),
|
||||
status: postStatusSchema.default('draft'),
|
||||
publishedAt: z.string().datetime().nullable().default(null),
|
||||
tags: z.array(z.string().trim().min(1)).default([])
|
||||
|
||||
@@ -9,6 +9,10 @@ export const postSchema = z.object({
|
||||
content: z.string(),
|
||||
excerpt: z.string().default(''),
|
||||
featuredImage: z.string().nullable().default(null),
|
||||
seoTitle: z.string().default(''),
|
||||
seoDescription: z.string().default(''),
|
||||
canonicalUrl: z.string().default(''),
|
||||
noindex: z.boolean().default(false),
|
||||
status: postStatusSchema,
|
||||
publishedAt: z.string().nullable().default(null),
|
||||
createdAt: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user