加快友情链接图片加载速度

This commit is contained in:
tangly1024.com
2024-01-31 16:48:45 +08:00
parent 3a9da4ed6a
commit eced20bfe7
2 changed files with 6 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ import BLOG from '@/blog.config'
* @param {*} value
* @returns
*/
const mapImgUrl = (img, block, type = 'block', from) => {
const mapImgUrl = (img, block, type = 'block', from = 'post') => {
if (!img) {
return null
}
@@ -56,10 +56,10 @@ const mapImgUrl = (img, block, type = 'block', from) => {
}
}
// 文章封面压缩
if (from === 'pageCoverThumbnail' || block.type === 'image') {
console.log('block', block)
// 统一压缩图片
const width = block?.format?.block_width
if (from === 'pageCoverThumbnail' || block.type === 'image' || block.type === 'page') {
const width = block?.format?.block_width || 200
ret = compressImage(ret, width)
}