diff --git a/components/HeroIcons.js b/components/HeroIcons.js index b4283aaf..8da9fbfa 100644 --- a/components/HeroIcons.js +++ b/components/HeroIcons.js @@ -26,4 +26,10 @@ const User = ({ className }) => { } -export { Moon, Sun, Home, User } + +const ArrowPath = ({ className }) => { + return + + +} +export { Moon, Sun, Home, User, ArrowPath } diff --git a/lib/notion/mapImage.js b/lib/notion/mapImage.js index 2e917b93..8fbfbb1c 100644 --- a/lib/notion/mapImage.js +++ b/lib/notion/mapImage.js @@ -6,7 +6,7 @@ import BLOG from '@/blog.config' * 2. UnPlash 图片可以通过api q=50 控制压缩质量 width=400 控制图片尺寸 * @param {*} image */ -const compressImage = (image, width = 300) => { +const compressImage = (image, width = 400, quality = 50, fmt = 'webp') => { if (!image) { return null } @@ -20,11 +20,12 @@ const compressImage = (image, width = 300) => { // 获取URL参数 const params = new URLSearchParams(urlObj.search) // 将q参数的值替换 - params.set('q', '50') + params.set('q', quality) // 尺寸 params.set('width', width) // 格式 - params.set('fmt', 'webp') + params.set('fmt', fmt) + params.set('fm', fmt) // 生成新的URL urlObj.search = params.toString() return urlObj.toString() diff --git a/styles/notion.css b/styles/notion.css index 65345f6d..f2f437f0 100644 --- a/styles/notion.css +++ b/styles/notion.css @@ -1950,14 +1950,6 @@ svg + .notion-page-title-text { @apply bg-blue-500 text-gray-50 !important; } -.dark img{ - @apply opacity-80 -} - -.dark #live2d { - @apply opacity-80 -} - /* https://github.com/kchen0x */ .notion-quote { display: block; diff --git a/themes/plog/components/BlogListPage.js b/themes/plog/components/BlogListPage.js index 9dbf6bd0..f8455ae7 100644 --- a/themes/plog/components/BlogListPage.js +++ b/themes/plog/components/BlogListPage.js @@ -19,7 +19,7 @@ export const BlogListPage = props => { return (
-
+
{posts?.map(post => ( ))} diff --git a/themes/plog/components/BlogPost.js b/themes/plog/components/BlogPost.js index fc7f710a..4f7c9bce 100644 --- a/themes/plog/components/BlogPost.js +++ b/themes/plog/components/BlogPost.js @@ -1,3 +1,6 @@ +import { compressImage } from '@/lib/notion/mapImage' +import Link from 'next/link' +import { usePlogGlobal } from '..' /** * 博客照片卡牌 @@ -6,15 +9,30 @@ */ const BlogPost = (props) => { const { post, siteInfo } = props - const pageThumbnail = post?.pageCoverThumbnail || siteInfo?.pageCover - console.log('缩略图', pageThumbnail, siteInfo) + const pageThumbnail = compressImage(post?.pageCoverThumbnail || siteInfo?.pageCover, 800, 80) + const { setModalContent, setShowModal } = usePlogGlobal() + const handleClick = () => { + setShowModal(true) + setModalContent(post) + } return ( -
+
{/* eslint-disable-next-line @next/next/no-img-element */} - -

+ +

{post?.title}

+ {post?.category &&
+ + {post?.category} + +
}
) diff --git a/themes/plog/components/BottomNav.js b/themes/plog/components/BottomNav.js index 186f2741..5567e3dc 100644 --- a/themes/plog/components/BottomNav.js +++ b/themes/plog/components/BottomNav.js @@ -15,7 +15,7 @@ const BottomNav = props => { const { navBarTitle, siteInfo } = props return <> -