관리자 미디어 카드 썸네일 탭 분리
This commit is contained in:
@@ -5,7 +5,8 @@ export const POST_THUMBNAIL_WIDTH = 640
|
||||
export const POST_THUMBNAIL_HEIGHT = 360
|
||||
export const POST_THUMBNAIL_QUALITY = 82
|
||||
|
||||
const postUploadUrlPattern = /^\/uploads\/posts\/\d{4}\/\d{2}\/[^?#]+$/i
|
||||
const postUploadUrlPattern = /^\/uploads\/posts\/\d{4}\/\d{2}\/[^/?#]+$/i
|
||||
const postThumbnailUrlPattern = /^\/uploads\/posts\/\d{4}\/\d{2}\/thumbs\/[^/?#]+-card\.webp$/i
|
||||
const postThumbnailDirectoryName = 'thumbs'
|
||||
const postThumbnailSuffix = '-card'
|
||||
const postThumbnailExtension = '.webp'
|
||||
@@ -72,6 +73,13 @@ export const getPostThumbnailUrl = (imageUrl) => {
|
||||
return `${directory}/${postThumbnailDirectoryName}/${getPostThumbnailFileName(fileName)}`
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시물 카드 썸네일 URL인지 확인한다.
|
||||
* @param {string|null|undefined} imageUrl - 검사할 이미지 URL
|
||||
* @returns {boolean} 카드 썸네일 여부
|
||||
*/
|
||||
export const isPostCardThumbnailUrl = (imageUrl) => Boolean(imageUrl && postThumbnailUrlPattern.test(imageUrl))
|
||||
|
||||
/**
|
||||
* 게시물 카드 썸네일 URL의 디스크 경로를 조회한다.
|
||||
* @param {string} imageUrl - 원본 이미지 URL
|
||||
|
||||
Reference in New Issue
Block a user