Replies: 8 comments
-
在我访问 https://www.nicemist.xyz/article/zwww 时,网站的图片似乎已经正常显示了: https://cdn.staticaly.com/gh/nicemist/blogpicgo@master/img/202305281944728.jpeg |
Beta Was this translation helpful? Give feedback.
-
我换了github的图床,你可以用图片的地址:https://s1.vika.cn/space/2023/05/08/1e1f9a11de774cc7a76d14a5c69fe49c ,放到notion网站里面,就可以复现了 |
Beta Was this translation helpful? Give feedback.
-
图床的防盗链功能检查一下,我在本地创建的页面中引入该图片显示403无权访问。 这张图片似乎只能在 https://s1.vika.cn 的域名下才能被加载 我的测试结果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<img src="https://s1.vika.cn/space/2023/05/08/1e1f9a11de774cc7a76d14a5c69fe49c"/>
</script>
</body>
</html>
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
啊哈,我后面又看了看请求头,以及mapImage.js,发现有个图片映射对图床做了区分。或许是这个问题。 github: https://github.com/chz8bit/NotionNext
不知道别的图床是怎么做的,cnblog的图床是失败了。我也在想next.config.js的domain里添加了域名,但也没用。 images: {
// 图片压缩
formats: ['image/avif', 'image/webp'],
// 允许next/image加载的图片 域名
domains: [
'gravatar.com',
'www.notion.so',
'avatars.githubusercontent.com',
'images.unsplash.com',
'source.unsplash.com',
'p1.qhimg.com',
'webmention.io',
'img2023.cnblogs.com',
'cnblogs.com'
]
}, |
Beta Was this translation helpful? Give feedback.
-
同样的问题,请问你有解决吗 |
Beta Was this translation helpful? Give feedback.
-
@LLeavesG 并没有解决。我换回Nobelium版本的了,发现这个不管是什么图床都会在前面加上notion.so,这样就可以图片获取成功。可能也和生命周期有关,但我没精力去研究了 :> |
Beta Was this translation helpful? Give feedback.
-
图床图片显示错误
在notion中编辑笔记时,插入了vika图床的照片,在notion中可以正常显示照片,在网站中显示不出来
网站地址:https://www.nicemist.xyz/article/zwww
复现步骤
在notion在新增笔记,添加图片地址:https://s1.vika.cn/space/2023/05/08/1e1f9a11de774cc7a76d14a5c69fe49c
在网站中查看新增的笔记图片,显示失败
期望的正常结果
网站可以正常显示图片
截图
![1](https://private-user-images.githubusercontent.com/61263540/241492474-ab52347e-d92d-46e2-ba6d-25f67aa0d0e6.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU5NjQ3OTQsIm5iZiI6MTcyNTk2NDQ5NCwicGF0aCI6Ii82MTI2MzU0MC8yNDE0OTI0NzQtYWI1MjM0N2UtZDkyZC00NmUyLWJhNmQtMjVmNjdhYTBkMGU2LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEwVDEwMzQ1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJhY2M0NjZhMzRjNTE3MDgzZTM2NmIxZTIxMWZlNTM1MDM5YTE0ZjExZWI0ZDNlMTBjZmQyMDU3MzU4YWE5MTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.x3iGDxN7gZVYxgN7jpEicoGSTh3U6iDdjD_vim6C0Y8)
环境
补充说明
已经在next.config.js中添加了图片的域名
domains: [ 'gravatar.com', 'www.notion.so', 'avatars.githubusercontent.com', 'images.unsplash.com', 'source.unsplash.com', 'p1.qhimg.com', 'webmention.io', 's1.vika.cn' ]
Beta Was this translation helpful? Give feedback.
All reactions