페이지 커버 썸네일 최적화
This commit is contained in:
@@ -35,8 +35,10 @@ import {
|
||||
} from '../../lib/upload-size-limit.js'
|
||||
import { normalizeSocialLinks } from '../../lib/social-links.js'
|
||||
import {
|
||||
createPageCoverThumbnailForImageUrl,
|
||||
createPostBodyThumbnailsForContent,
|
||||
createPostThumbnailForImageUrl,
|
||||
getExistingPageCoverThumbnailUrl,
|
||||
getExistingPostThumbnailUrl
|
||||
} from '../utils/post-thumbnail-image.js'
|
||||
import { getPostgresClient } from './postgres-client'
|
||||
@@ -94,6 +96,7 @@ const mapPageRow = (row) => ({
|
||||
renderMode: row.render_mode || 'markdown',
|
||||
status: row.status || 'published',
|
||||
featuredImage: row.featured_image,
|
||||
listingImageThumbnail: getExistingPageCoverThumbnailUrl(row.featured_image),
|
||||
isListed: Boolean(row.is_listed),
|
||||
isFeatured: Boolean(row.is_featured),
|
||||
listingSection: row.listing_section || '',
|
||||
@@ -1121,6 +1124,8 @@ export const createAdminPage = async (input) => {
|
||||
RETURNING *
|
||||
`
|
||||
|
||||
await createPageCoverThumbnailForImageUrl(input.featuredImage)
|
||||
|
||||
return mapPageRow(rows[0])
|
||||
}
|
||||
|
||||
@@ -1157,6 +1162,10 @@ export const updateAdminPage = async (id, input) => {
|
||||
RETURNING *
|
||||
`
|
||||
|
||||
if (rows[0]) {
|
||||
await createPageCoverThumbnailForImageUrl(input.featuredImage)
|
||||
}
|
||||
|
||||
return rows[0] ? mapPageRow(rows[0]) : null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user