caption-fix
Some checks failed
deploy / test (push) Failing after 55s
deploy / deploy (push) Has been skipped

This commit is contained in:
Untone 2023-12-07 22:07:22 +03:00
parent d0ccd661e3
commit e42c69c2b1
2 changed files with 2 additions and 9 deletions

View File

@ -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>

View File

@ -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', '')}`
}