mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-19 07:26:50 +00:00
feat 压缩网站Notion头像
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
import BLOG from '@/blog.config'
|
||||
|
||||
/**
|
||||
* notion图片可以通过指定url-query参数来压缩裁剪图片 例如 ?width=200
|
||||
* @param {*} image
|
||||
*/
|
||||
const compressImage = (image) => {
|
||||
if (image.indexOf(BLOG.NOTION_HOST) === 0) {
|
||||
return image + '&width=200'
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Notion图片映射处理有emoji的图标
|
||||
* @param {*} img
|
||||
@@ -32,4 +41,4 @@ const mapImgUrl = (img, block, type = 'block') => {
|
||||
return ret
|
||||
}
|
||||
|
||||
export { mapImgUrl }
|
||||
export { mapImgUrl, compressImage }
|
||||
|
||||
Reference in New Issue
Block a user