v0.0.86: 미리보기 패딩, 태그 한글 유지, SEO 자동, 태그 관리 토스트
This commit is contained in:
@@ -98,20 +98,46 @@ const mapNavigationItemRow = (row) => ({
|
||||
* @param {Array<string>} tags - 태그 슬러그 목록
|
||||
* @returns {Array<string>} 정규화된 태그 슬러그 목록
|
||||
*/
|
||||
const normalizeTagSlugs = (tags = []) => [...new Set(tags
|
||||
.map((tag) => String(tag).trim().toLowerCase())
|
||||
.filter(Boolean))]
|
||||
const normalizeTagSlugs = (tags = []) => {
|
||||
const seen = new Set()
|
||||
const out = []
|
||||
|
||||
for (const tag of tags) {
|
||||
const trimmed = String(tag).trim().normalize('NFC')
|
||||
if (!trimmed) {
|
||||
continue
|
||||
}
|
||||
const dedupeKey = trimmed.toLowerCase()
|
||||
if (seen.has(dedupeKey)) {
|
||||
continue
|
||||
}
|
||||
seen.add(dedupeKey)
|
||||
out.push(trimmed)
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
/**
|
||||
* 태그 슬러그를 태그명으로 변환
|
||||
* 태그 슬러그를 표시용 태그명으로 변환
|
||||
* @param {string} slug - 태그 슬러그
|
||||
* @returns {string} 태그명
|
||||
*/
|
||||
const getTagNameFromSlug = (slug) => slug
|
||||
.split('-')
|
||||
.filter(Boolean)
|
||||
.map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`)
|
||||
.join(' ')
|
||||
const getTagNameFromSlug = (slug) => {
|
||||
const trimmed = String(slug).trim()
|
||||
if (!trimmed) {
|
||||
return ''
|
||||
}
|
||||
if (/[가-힣]/.test(trimmed)) {
|
||||
return trimmed.split('-').filter(Boolean).join(' ')
|
||||
}
|
||||
|
||||
return trimmed
|
||||
.split('-')
|
||||
.filter(Boolean)
|
||||
.map((word) => `${word.charAt(0).toUpperCase()}${word.slice(1)}`)
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시물 태그 연결 저장
|
||||
|
||||
@@ -7,8 +7,8 @@ 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(''),
|
||||
seoTitle: z.string().trim().default(''),
|
||||
seoDescription: z.string().trim().default(''),
|
||||
canonicalUrl: z.string().trim().url().or(z.literal('')).default(''),
|
||||
noindex: z.boolean().default(false),
|
||||
ogImage: z.string().trim().nullable().default(null),
|
||||
|
||||
Reference in New Issue
Block a user