mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-23 15:09:46 +00:00
增加对notion.so自定义反代域名的配置支持
This commit is contained in:
@@ -115,7 +115,7 @@ function getImageUrl(imgObj, blockVal) {
|
||||
return null
|
||||
}
|
||||
if (imgObj.startsWith('/')) {
|
||||
return 'https://www.notion.so' + imgObj // notion内部图片转相对路径为绝对路径
|
||||
return BLOG.NOTION_HOST + imgObj // notion内部图片转相对路径为绝对路径
|
||||
}
|
||||
|
||||
if (imgObj.startsWith('http')) {
|
||||
|
||||
@@ -12,7 +12,7 @@ const mapImgUrl = (img, block, type = 'block') => {
|
||||
return ret
|
||||
}
|
||||
// 相对目录,则视为notion的自带图片
|
||||
if (img.startsWith('/')) ret = 'https://www.notion.so' + img
|
||||
if (img.startsWith('/')) ret = BLOG.NOTION_HOST + img
|
||||
|
||||
// 书签的地址本身就是永久链接,无需处理
|
||||
if (!ret && block?.type === 'bookmark') {
|
||||
@@ -21,7 +21,7 @@ const mapImgUrl = (img, block, type = 'block') => {
|
||||
|
||||
// notion永久图床地址
|
||||
if (!ret && img.indexOf('secure.notion-static.com') > 0 && (BLOG.IMG_URL_TYPE === 'Notion' || type !== 'block')) {
|
||||
ret = 'https://www.notion.so/image/' + encodeURIComponent(img) + '?table=' + type + '&id=' + block.id
|
||||
ret = BLOG.NOTION_HOST + '/image/' + encodeURIComponent(img) + '?table=' + type + '&id=' + block.id
|
||||
}
|
||||
|
||||
// 剩余的是第三方图片url或emoji
|
||||
|
||||
Reference in New Issue
Block a user