mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-29 15:10:06 +00:00
Notion新图床兼容
This commit is contained in:
@@ -23,18 +23,21 @@ const mapImgUrl = (img, block, type = 'block', needCompress = true) => {
|
|||||||
ret = img
|
ret = img
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notion 图床转换为永久地址
|
|
||||||
const hasConverted =
|
const hasConverted =
|
||||||
ret.indexOf('https://www.notion.so/image') === 0 ||
|
ret.indexOf('https://www.notion.so/image') === 0 ||
|
||||||
ret.includes('notion.site/images/page-cover/')
|
ret.includes('notion.site/images/page-cover/')
|
||||||
|
|
||||||
// 需要转化的URL ; 识别aws图床地址,或者bookmark类型的外链图片
|
// 需要转化的URL ; 识别aws图床地址,或者bookmark类型的外链图片
|
||||||
|
// Notion新图床资源 格式为 attachment:${id}:${name}
|
||||||
const needConvert =
|
const needConvert =
|
||||||
!hasConverted &&
|
!hasConverted &&
|
||||||
(block.type === 'bookmark' ||
|
(block.type === 'bookmark' ||
|
||||||
ret.includes('secure.notion-static.com') ||
|
ret.includes('secure.notion-static.com') ||
|
||||||
ret.includes('prod-files-secure'))
|
ret.includes('prod-files-secure')) ||
|
||||||
|
ret.indexOf('attachment')===0
|
||||||
|
|
||||||
// 使用Notion图传
|
|
||||||
|
// Notion旧图床
|
||||||
if (needConvert) {
|
if (needConvert) {
|
||||||
ret =
|
ret =
|
||||||
BLOG.NOTION_HOST +
|
BLOG.NOTION_HOST +
|
||||||
|
|||||||
Reference in New Issue
Block a user