caption-fix
This commit is contained in:
parent
d0ccd661e3
commit
e42c69c2b1
|
@ -317,7 +317,7 @@ export const FullArticle = (props: Props) => {
|
|||
props.article.layout !== 'image'
|
||||
}
|
||||
>
|
||||
<Image width={800} alt={props.article.title} src={props.article.cover} />
|
||||
<Image width={800} alt={props.article.cover_caption} src={props.article.cover} />
|
||||
</Show>
|
||||
</div>
|
||||
</Show>
|
||||
|
|
|
@ -14,12 +14,5 @@ const getSizeUrlPart = (options: { width?: number; height?: number } = {}) => {
|
|||
export const getImageUrl = (src: string, options: { width?: number; height?: number } = {}) => {
|
||||
const sizeUrlPart = getSizeUrlPart(options)
|
||||
|
||||
const thumborPrefix = `${thumborUrl}/unsafe/`
|
||||
|
||||
if (src.startsWith(thumborPrefix)) {
|
||||
const thumborKey = src.replace(thumborPrefix, '')
|
||||
return `${thumborUrl}/unsafe/${sizeUrlPart}${thumborKey}`
|
||||
}
|
||||
|
||||
return `${thumborUrl}/unsafe/${sizeUrlPart}${src}`
|
||||
return `${thumborUrl}/unsafe/${sizeUrlPart}${src.replace(thumborUrl, '').replace('/unsafe', '')}`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user