From ebf55f504f5cbb7dbbc5a0b7a20976643a54560b Mon Sep 17 00:00:00 2001 From: CodeMaker-Zhao Date: Sat, 3 Dec 2022 21:30:27 +0800 Subject: [PATCH] fix: solve linked img crash --- themes/hexo/components/BlogPostCard.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js index 45d3e24a..8105e545 100644 --- a/themes/hexo/components/BlogPostCard.js +++ b/themes/hexo/components/BlogPostCard.js @@ -7,6 +7,11 @@ import NotionPage from '@/components/NotionPage' const BlogPostCard = ({ post, showSummary }) => { const showPreview = CONFIG_HEXO.POST_LIST_PREVIEW && post.blockMap + const linkedCoverPrefix = 'https://www.notion.so/image/' + if (post?.page_cover && post?.page_cover?.startsWith(linkedCoverPrefix)) { + const linkedCoverPrefixLength = linkedCoverPrefix.length + post.page_cover = decodeURIComponent(post.page_cover.slice(linkedCoverPrefixLength)) + } return (