增加对notion.so自定义反代域名的配置支持

This commit is contained in:
emengweb
2023-04-24 10:53:44 +00:00
parent 84fe9e5e63
commit 5ec7862a33
3 changed files with 8 additions and 3 deletions

View File

@@ -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')) {

View File

@@ -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

View File

@@ -22,4 +22,9 @@
width: 100%;
height: 100%;
background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 10%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.2) 75%, rgba(0,0,0,0.5) 100%);
}
/* Custem */
.tk-footer{
opacity: 0;
}