mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-17 15:09:31 +00:00
加快友情链接图片加载速度
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user