v1.2.9: 라이브 에디터·홈 피드·메인 커버 개선
라이브 모드 코드/콜아웃/토글 편집, 슬래시 명령, 홈 Latest List·Compact·Cards 보기, 사이트 설정 메인 화면 커버(720px) 및 HomeHero 반영. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -94,6 +94,9 @@ const mapSiteSettingsRow = (row) => ({
|
||||
faviconUrl: row.favicon_url || '',
|
||||
copyrightText: row.copyright_text,
|
||||
showPostUpdatedAt: Boolean(row.show_post_updated_at),
|
||||
homeCoverImageUrl: row.home_cover_image_url || '',
|
||||
homeCoverTitle: row.home_cover_title || '',
|
||||
homeCoverText: row.home_cover_text || '',
|
||||
updatedAt: row.updated_at.toISOString()
|
||||
})
|
||||
|
||||
@@ -810,6 +813,9 @@ export const updateSiteSettings = async (input) => {
|
||||
favicon_url,
|
||||
copyright_text,
|
||||
show_post_updated_at,
|
||||
home_cover_image_url,
|
||||
home_cover_title,
|
||||
home_cover_text,
|
||||
updated_at
|
||||
)
|
||||
VALUES (
|
||||
@@ -822,6 +828,9 @@ export const updateSiteSettings = async (input) => {
|
||||
${input.faviconUrl || ''},
|
||||
${input.copyrightText},
|
||||
${input.showPostUpdatedAt ? true : false},
|
||||
${input.homeCoverImageUrl || ''},
|
||||
${input.homeCoverTitle || ''},
|
||||
${input.homeCoverText || ''},
|
||||
now()
|
||||
)
|
||||
ON CONFLICT (id) DO UPDATE
|
||||
@@ -834,6 +843,9 @@ export const updateSiteSettings = async (input) => {
|
||||
favicon_url = EXCLUDED.favicon_url,
|
||||
copyright_text = EXCLUDED.copyright_text,
|
||||
show_post_updated_at = EXCLUDED.show_post_updated_at,
|
||||
home_cover_image_url = EXCLUDED.home_cover_image_url,
|
||||
home_cover_title = EXCLUDED.home_cover_title,
|
||||
home_cover_text = EXCLUDED.home_cover_text,
|
||||
updated_at = now()
|
||||
RETURNING *
|
||||
`
|
||||
@@ -877,6 +889,39 @@ export const updateSiteLogo = async (input) => {
|
||||
return mapSiteSettingsRow(rows[0])
|
||||
}
|
||||
|
||||
/**
|
||||
* 메인 화면 커버 이미지 URL을 수정한다.
|
||||
* @param {{ homeCoverImageUrl: string }} input - 커버 이미지 URL
|
||||
* @returns {Promise<Object>} 수정된 사이트 설정
|
||||
*/
|
||||
export const updateSiteHomeCoverImage = async (input) => {
|
||||
const sql = getPostgresClient()
|
||||
|
||||
if (!sql) {
|
||||
throw new Error('DATABASE_REQUIRED')
|
||||
}
|
||||
|
||||
const rows = await sql`
|
||||
INSERT INTO site_settings (
|
||||
id,
|
||||
home_cover_image_url,
|
||||
updated_at
|
||||
)
|
||||
VALUES (
|
||||
1,
|
||||
${input.homeCoverImageUrl || ''},
|
||||
now()
|
||||
)
|
||||
ON CONFLICT (id) DO UPDATE
|
||||
SET
|
||||
home_cover_image_url = EXCLUDED.home_cover_image_url,
|
||||
updated_at = now()
|
||||
RETURNING *
|
||||
`
|
||||
|
||||
return mapSiteSettingsRow(rows[0])
|
||||
}
|
||||
|
||||
/**
|
||||
* 네비게이션 항목 목록 조회
|
||||
* @param {Object} options - 조회 옵션
|
||||
|
||||
Reference in New Issue
Block a user