mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
Merge branch 'feat/theme-commerce' of https://github.com/tangly1024/NotionNext into feat/theme-commerce
This commit is contained in:
@@ -2,7 +2,7 @@ import { siteConfig } from '@/lib/config'
|
||||
import Head from 'next/head'
|
||||
|
||||
const CommonHead = ({ meta, children }) => {
|
||||
let url = siteConfig('PATH')?.length ? `${siteConfig('LINK')}/${siteConfig('SUB_PATH')}` : siteConfig('LINK')
|
||||
let url = siteConfig('PATH')?.length ? `${siteConfig('LINK')}/${siteConfig('SUB_PATH','')}` : siteConfig('LINK')
|
||||
let image
|
||||
if (meta) {
|
||||
url = `${url}/${meta.slug}`
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
|
||||
(<Link
|
||||
key={post.id}
|
||||
title={post.title}
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="flex h-40 cursor-pointer overflow-hidden">
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
|
||||
<span className="text-gray-400">{post.date?.start_date}</span>{' '}
|
||||
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="dark:text-gray-400 dark:hover:text-red-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary
|
||||
<div>
|
||||
{/* 标题 */}
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className={`line-clamp-2 replace cursor-pointer text-2xl ${showPreview ? 'text-center' : ''
|
||||
} leading-tight font-normal text-gray-600 dark:text-gray-100 hover:text-red-700 dark:hover:text-red-400`}>
|
||||
|
||||
@@ -57,7 +57,7 @@ const Footer = (props) => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{siteConfig('COMMERCE_TEXT_FOOTER_LINKS') && <div className='md:border-l pl-4 border-gray-600 my-6 whitespace-pre-line text-left flex-grow'>
|
||||
{JSON.parse(siteConfig('COMMERCE_TEXT_FOOTER_LINKS', true)) && <div className='md:border-l pl-4 border-gray-600 my-6 whitespace-pre-line text-left flex-grow'>
|
||||
<div className='font-bold text-l text-white mb-6'>{siteConfig('COMMERCE_TEXT_FOOTER_TITLE', 'Contact US')}</div>
|
||||
<div className='space-y-4'>
|
||||
<div className='flex space-x-4 text-2xl'>
|
||||
|
||||
@@ -28,7 +28,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
|
||||
</div>
|
||||
</div>
|
||||
{latestPosts.map(post => {
|
||||
const selected = currentPath === `${siteConfig('SUB_PATH')}/${post.slug}`
|
||||
const selected = currentPath === `${siteConfig('SUB_PATH', '')}/${post.slug}`
|
||||
|
||||
const headerImage = post?.pageCoverThumbnail ? post.pageCoverThumbnail : siteInfo?.pageCover
|
||||
|
||||
@@ -36,7 +36,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
|
||||
(<Link
|
||||
key={post.id}
|
||||
title={post.title}
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className={'my-3 flex'}>
|
||||
|
||||
|
||||
@@ -7,28 +7,28 @@ export default function PostHeader({ post, siteInfo }) {
|
||||
return <></>
|
||||
}
|
||||
const headerImage = post?.pageCover ? post.pageCover : siteInfo?.pageCover
|
||||
|
||||
const title = post?.title
|
||||
return (
|
||||
<div id="header" className="w-full h-96 relative md:flex-shrink-0 z-10" >
|
||||
<LazyImage priority={true} src={headerImage} className='w-full h-full object-cover object-center absolute top-0'/>
|
||||
<LazyImage priority={true} src={headerImage} className='w-full h-full object-cover object-center absolute top-0' />
|
||||
|
||||
<header id='article-header-cover'
|
||||
className="bg-black bg-opacity-70 absolute top-0 w-full h-96 py-10 flex justify-center items-center ">
|
||||
className="bg-black bg-opacity-70 absolute top-0 w-full h-96 py-10 flex justify-center items-center ">
|
||||
|
||||
<div className='mt-10'>
|
||||
<div className='mb-3 flex justify-center'>
|
||||
{post.category && <>
|
||||
<Link href={`/category/${post.category}`} passHref legacyBehavior>
|
||||
<div className="cursor-pointer px-2 py-1 mb-2 border rounded-sm dark:border-white text-sm font-medium hover:underline duration-200 shadow-text-md text-white">
|
||||
{post.category}
|
||||
</div>
|
||||
</Link>
|
||||
</>}
|
||||
</div>
|
||||
<div className='mb-3 flex justify-center'>
|
||||
{post.category && <>
|
||||
<Link href={`/category/${post.category}`} passHref legacyBehavior>
|
||||
<div className="cursor-pointer px-2 py-1 mb-2 border rounded-sm dark:border-white text-sm font-medium hover:underline duration-200 shadow-text-md text-white">
|
||||
{post.category}
|
||||
</div>
|
||||
</Link>
|
||||
</>}
|
||||
</div>
|
||||
|
||||
{/* 文章Title */}
|
||||
<div className="leading-snug font-bold xs:text-4xl sm:text-4xl md:text-5xl md:leading-snug text-4xl shadow-text-md flex justify-center text-center text-white">
|
||||
<NotionIcon icon={post.pageIcon} className='text-4xl mx-1' />{post.title}
|
||||
<NotionIcon icon={post.pageIcon} className='text-4xl mx-1' /><div className='text-4xl mx-1'>{title}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@ const ProductCard = ({ index, post, siteInfo }) => {
|
||||
<div key={post.id} className={'group flex flex-col space-y-2 justify-between border dark:border-black bg-white dark:bg-hexo-black-gray'}>
|
||||
|
||||
{/* 图片封面 */}
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} passHref legacyBehavior>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} passHref legacyBehavior>
|
||||
<div className="overflow-hidden m-2">
|
||||
<LazyImage priority={index === 1} src={post?.pageCoverThumbnail} className='h-auto aspect-square w-full object-cover object-center group-hover:scale-110 duration-500' />
|
||||
</div>
|
||||
|
||||
@@ -113,7 +113,7 @@ const LayoutIndex = (props) => {
|
||||
{/* 首页企业/品牌介绍 */}
|
||||
{notice && <div id='brand-introduction' className='w-full my-4 mx-4'>
|
||||
<div className='w-full text-center text-4xl font-bold pt-12'>{siteConfig('TEXT_HOME_ABOUT_US', notice.title)}</div>
|
||||
<NotionPage post={notice} className='text-2xl text-justify'/>
|
||||
<NotionPage post={notice} className='text-2xl text-justify' />
|
||||
</div>}
|
||||
|
||||
{/* 铺开导航菜单 */}
|
||||
@@ -201,21 +201,11 @@ const LayoutSlug = props => {
|
||||
|
||||
const targetRef = isBrowser ? document.getElementById('article-wrapper') : null
|
||||
const headerImage = post?.pageCover ? post.pageCover : siteConfig('HOME_BANNER_IMAGE')
|
||||
|
||||
// const floatSlot = <>
|
||||
// {post?.toc?.length > 1 && <div className="block lg:hidden">
|
||||
// <TocDrawerButton
|
||||
// onClick={() => {
|
||||
// drawerRight?.current?.handleSwitchVisible()
|
||||
// }}
|
||||
// />
|
||||
// </div>}
|
||||
// <JumpToCommentButton />
|
||||
// </>
|
||||
const floatSlot = <></>
|
||||
const headerSlot = <PostHeader {...props} />
|
||||
|
||||
return (
|
||||
<LayoutBase {...props} headerSlot={<PostHeader {...props} />} showCategory={false} showTag={false} floatSlot={floatSlot} >
|
||||
<LayoutBase {...props} headerSlot={headerSlot} showCategory={false} showTag={false} floatSlot={floatSlot} >
|
||||
<div className="w-full max-w-screen-xl mx-auto lg:hover:shadow lg:border lg:px-2 lg:py-4 bg-white dark:bg-hexo-black-gray dark:border-black article">
|
||||
{lock && <ArticleLock validPassword={validPassword} />}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function BlogListGroupByDate({ archiveTitle, archivePosts }) {
|
||||
{post?.publishDay}
|
||||
</span>{' '}
|
||||
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
{post.title}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,7 @@ const BlogPostCard = ({ post }) => {
|
||||
{/* 图片封面 */}
|
||||
{showPageCover && (
|
||||
<div className="md:w-5/12 w-full h-44 overflow-hidden p-1">
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} passHref legacyBehavior>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} passHref legacyBehavior>
|
||||
<LazyImage src={post?.pageCoverThumbnail} className='w-full bg-cover hover:scale-110 duration-200' />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -25,7 +25,7 @@ const BlogCard = ({ index, post, showSummary, siteInfo }) => {
|
||||
{/* 封面图 */}
|
||||
{showPageCover && (
|
||||
<div className="flex-grow mb-3 w-full duration-200 cursor-pointer transform overflow-hidden">
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} passHref legacyBehavior>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} passHref legacyBehavior>
|
||||
<LazyImage
|
||||
src={post?.pageCoverThumbnail}
|
||||
alt={post?.title || siteConfig('TITLE')}
|
||||
@@ -37,7 +37,7 @@ const BlogCard = ({ index, post, showSummary, siteInfo }) => {
|
||||
|
||||
{/* 文字部分 */}
|
||||
<div className="flex flex-col w-full">
|
||||
<Link passHref href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
<Link passHref href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
className={`break-words cursor-pointer font-bold hover:underline text-xl ${showPreview ? 'justify-center' : 'justify-start'} leading-tight text-gray-700 dark:text-gray-100 hover:text-blue-500 dark:hover:text-blue-400`}
|
||||
>
|
||||
{post.title}
|
||||
|
||||
@@ -30,7 +30,7 @@ const BlogArchiveItem = ({ posts = [], archiveTitle }) => {
|
||||
<span className="text-gray-400">{post.date?.start_date}</span>{' '}
|
||||
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
|
||||
</span>{' '}
|
||||
|
||||
|
||||
<Link passHref href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
<Link passHref href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
{post.title}
|
||||
</Link>
|
||||
|
||||
@@ -8,7 +8,7 @@ const BlogPostCard = ({ post, className }) => {
|
||||
return (
|
||||
<div key={post.id} className={`${className} py-1 cursor-pointer px-2 hover:bg-gray-50 rounded-md dark:hover:bg-gray-600 ${currentSelected ? 'bg-green-50 text-green-500' : ''}`}>
|
||||
<div className="flex flex-col w-full select-none">
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} passHref>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} passHref>
|
||||
{post.title}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
|
||||
(<Link
|
||||
key={post.id}
|
||||
title={post.title}
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="flex h-40 cursor-pointer overflow-hidden rounded-2xl">
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle, siteInfo }) => {
|
||||
{/* 图片封面 */}
|
||||
{showPageCover && (
|
||||
<div>
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} passHref legacyBehavior>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} passHref legacyBehavior>
|
||||
<LazyImage className={'rounded-xl bg-center bg-cover w-40 h-24'} src={post?.pageCoverThumbnail}/>
|
||||
</Link>
|
||||
</div>
|
||||
@@ -53,7 +53,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle, siteInfo }) => {
|
||||
|
||||
{/* 标题 */}
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className={' group-hover:text-indigo-700 group-hover:dark:text-indigo-400 text-black dark:text-gray-100 dark:group-hover:text-yellow-600 line-clamp-2 replace cursor-pointer text-xl font-extrabold leading-tight'}>
|
||||
<span className='menu-link '>{post.title}</span>
|
||||
|
||||
@@ -22,7 +22,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
|
||||
|
||||
{/* 图片封面 */}
|
||||
{showPageCover && (
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} passHref legacyBehavior>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} passHref legacyBehavior>
|
||||
<div className="w-full md:w-5/12 2xl:w-full overflow-hidden">
|
||||
<LazyImage priority={index === 0} src={post?.pageCoverThumbnail} alt={post?.title} className='h-60 w-full object-cover group-hover:scale-105 group-hover:brightness-75 transition-all duration-300' />
|
||||
</div>
|
||||
@@ -42,7 +42,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
|
||||
|
||||
{/* 标题 */}
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className={' group-hover:text-indigo-700 dark:hover:text-yellow-700 dark:group-hover:text-yellow-600 text-black dark:text-gray-100 line-clamp-2 replace cursor-pointer text-xl font-extrabold leading-tight'}>
|
||||
<span className='menu-link '>{post.title}</span>
|
||||
|
||||
@@ -69,7 +69,7 @@ function Banner(props) {
|
||||
function handleClickBanner() {
|
||||
const randomIndex = Math.floor(Math.random() * latestPosts.length)
|
||||
const randomPost = latestPosts[randomIndex]
|
||||
router.push(`${siteConfig('SUB_PATH')}/${randomPost?.slug}`)
|
||||
router.push(`${siteConfig('SUB_PATH', '')}/${randomPost?.slug}`)
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -232,7 +232,7 @@ function TopGroup(props) {
|
||||
>
|
||||
{topPosts?.map((p, index) => {
|
||||
return (
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${p?.slug}`} key={index}>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${p?.slug}`} key={index}>
|
||||
<div className="cursor-pointer h-[164px] group relative flex flex-col w-52 xl:w-full overflow-hidden shadow bg-white dark:bg-black dark:text-white rounded-xl">
|
||||
<LazyImage
|
||||
priority={index === 0}
|
||||
|
||||
@@ -22,7 +22,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
|
||||
return (
|
||||
(<Link key={post.id} passHref
|
||||
title={post.title}
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
|
||||
className={'my-3 flex flex-col w-full'}>
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function LatestPostsGroupMini ({ latestPosts, siteInfo }) {
|
||||
</div>
|
||||
</div>
|
||||
{latestPosts.map(post => {
|
||||
const selected = currentPath === `${siteConfig('SUB_PATH')}/${post.slug}`
|
||||
const selected = currentPath === `${siteConfig('SUB_PATH', '')}/${post.slug}`
|
||||
|
||||
const headerImage = post?.pageCoverThumbnail ? post.pageCoverThumbnail : siteInfo?.pageCover
|
||||
|
||||
@@ -36,7 +36,7 @@ export default function LatestPostsGroupMini ({ latestPosts, siteInfo }) {
|
||||
(<Link
|
||||
key={post.id}
|
||||
title={post.title}
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className={'my-3 flex'}>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function RandomPostButton(props) {
|
||||
function handleClick() {
|
||||
const randomIndex = Math.floor(Math.random() * latestPosts.length)
|
||||
const randomPost = latestPosts[randomIndex]
|
||||
router.push(`${siteConfig('SUB_PATH')}/${randomPost?.slug}`)
|
||||
router.push(`${siteConfig('SUB_PATH', '')}/${randomPost?.slug}`)
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
|
||||
(<Link
|
||||
key={post.id}
|
||||
title={post.title}
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="flex h-40 cursor-pointer overflow-hidden">
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
|
||||
<span className="text-gray-400">{post.date?.start_date}</span>{' '}
|
||||
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="dark:text-gray-400 dark:hover:text-indigo-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
|
||||
{/* 图片封面 */}
|
||||
{showPageCover && (
|
||||
<div className="md:w-5/12 overflow-hidden">
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} passHref legacyBehavior>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} passHref legacyBehavior>
|
||||
<LazyImage priority={index === 1} src={post?.pageCoverThumbnail} className='h-56 w-full object-cover object-center group-hover:scale-110 duration-500' />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@ export const BlogPostCardInfo = ({ post, showPreview, showPageCover, showSummary
|
||||
<div>
|
||||
{/* 标题 */}
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className={`line-clamp-2 replace cursor-pointer text-2xl ${showPreview ? 'text-center' : ''
|
||||
} leading-tight font-normal text-gray-600 dark:text-gray-100 hover:text-indigo-700 dark:hover:text-indigo-400`}>
|
||||
|
||||
@@ -28,7 +28,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
|
||||
</div>
|
||||
</div>
|
||||
{latestPosts.map(post => {
|
||||
const selected = currentPath === `${siteConfig('SUB_PATH')}/${post.slug}`
|
||||
const selected = currentPath === `${siteConfig('SUB_PATH', '')}/${post.slug}`
|
||||
|
||||
const headerImage = post?.pageCoverThumbnail ? post.pageCoverThumbnail : siteInfo?.pageCover
|
||||
|
||||
@@ -36,7 +36,7 @@ const LatestPostsGroup = ({ latestPosts, siteInfo }) => {
|
||||
(<Link
|
||||
key={post.id}
|
||||
title={post.title}
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className={'my-3 flex'}>
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function ArticleRecommend({ recommendPosts, siteInfo }) {
|
||||
(<Link
|
||||
key={post.id}
|
||||
title={post.title}
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="flex h-40 cursor-pointer overflow-hidden">
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
|
||||
<span className="text-gray-400">{post.date?.start_date}</span>{' '}
|
||||
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="dark:text-gray-400 dark:hover:text-indigo-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ const BlogPostCard = ({ index, post, showSummary, siteInfo }) => {
|
||||
|
||||
{/* 头部图片 填充卡片 */}
|
||||
{showPageCover && (
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} passHref legacyBehavior>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} passHref legacyBehavior>
|
||||
<div className="flex flex-grow w-full relative duration-200 = rounded-t-md cursor-pointer transform overflow-hidden">
|
||||
<LazyImage
|
||||
src={post?.pageCoverThumbnail}
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
|
||||
</span>{' '}
|
||||
|
||||
|
||||
<Link passHref href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
<Link passHref href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
{post.title}
|
||||
</Link>
|
||||
|
||||
@@ -23,7 +23,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
|
||||
<div className="lg:py-8 py-4 flex flex-col w-full">
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className={
|
||||
'cursor-pointer font-bold hover:underline text-3xl leading-tight text-gray-700 dark:text-gray-300 hover:text-green-500 dark:hover:text-green-400'
|
||||
@@ -62,7 +62,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
<div className="pointer-events-none border-t pt-8 border-dashed">
|
||||
<div className="w-full justify-start flex">
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="hover:bg-opacity-100 hover:scale-105 duration-200 pointer-events-auto transform font-bold text-green-500 cursor-pointer">
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
|
||||
</span>{' '}
|
||||
|
||||
|
||||
<Link passHref href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
<Link passHref href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
{post.title}
|
||||
</Link>
|
||||
|
||||
@@ -30,7 +30,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
|
||||
<span className="text-gray-400">{post.date?.start_date}</span>{' '}
|
||||
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
>
|
||||
<div className="lg:p-8 p-4 flex flex-col w-full">
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
data-aos="fade-down"
|
||||
data-aos-duration="500"
|
||||
@@ -104,7 +104,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
|
||||
<div className="text-right border-t pt-8 border-dashed">
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
className="hover:bg-opacity-100 hover:underline transform duration-300 p-3 text-white bg-gray-800 cursor-pointer">
|
||||
|
||||
{locale.COMMON.ARTICLE_DETAIL}
|
||||
@@ -115,7 +115,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
</div>
|
||||
|
||||
{CONFIG.POST_LIST_COVER && post?.pageCoverThumbnail && (
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} passHref legacyBehavior>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} passHref legacyBehavior>
|
||||
<div className="h-72 w-full relative duration-200 cursor-pointer transform overflow-hidden">
|
||||
<Image
|
||||
className="hover:scale-105 transform duration-500"
|
||||
|
||||
@@ -26,12 +26,12 @@ const LatestPostsGroup = ({ latestPosts }) => {
|
||||
</div>
|
||||
</div>
|
||||
{latestPosts.map(post => {
|
||||
const selected = currentPath === `${siteConfig('SUB_PATH')}/${post.slug}`
|
||||
const selected = currentPath === `${siteConfig('SUB_PATH', '')}/${post.slug}`
|
||||
return (
|
||||
(<Link
|
||||
key={post.id}
|
||||
title={post.title}
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className={'my-1 flex font-light'}>
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
|
||||
</span>{' '}
|
||||
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { siteConfig } from '@/lib/config'
|
||||
|
||||
const BlogPost = ({ post }) => {
|
||||
return (
|
||||
(<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`}>
|
||||
(<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}>
|
||||
|
||||
<article key={post.id} className="mb-6 md:mb-8">
|
||||
<header className="flex flex-col justify-between md:flex-row md:items-baseline">
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function RandomPostButton(props) {
|
||||
function handleClick() {
|
||||
const randomIndex = Math.floor(Math.random() * latestPosts.length)
|
||||
const randomPost = latestPosts[randomIndex]
|
||||
router.push(`${siteConfig('SUB_PATH')}/${randomPost?.slug}`)
|
||||
router.push(`${siteConfig('SUB_PATH', '')}/${randomPost?.slug}`)
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
|
||||
</span>{' '}
|
||||
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ export default function Modal(props) {
|
||||
<h2 style={{ textShadow: '0.1em 0.1em 0.2em black' }} className='text-2xl md:text-5xl text-white mb-4 px-2 py-1 rounded-lg'>{modalContent?.title}</h2>
|
||||
</div>
|
||||
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${modalContent.slug}`}>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${modalContent.slug}`}>
|
||||
<div style={{ textShadow: '0.1em 0.1em 0.2em black' }} className={'line-clamp-3 md:line-clamp-none overflow-hidden cursor-pointer text-gray-50 rounded-lg m-2'}>
|
||||
{modalContent?.summary}
|
||||
</div>
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
|
||||
</span>{' '}
|
||||
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
passHref
|
||||
className="dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600">
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ export const BlogItem = props => {
|
||||
|
||||
<h2 className="mb-2">
|
||||
<Link
|
||||
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
|
||||
href={`${siteConfig('SUB_PATH', '')}/${post.slug}`}
|
||||
className="blog-item-title font-bold text-black text-2xl menu-link">
|
||||
{post.title}
|
||||
</Link>
|
||||
@@ -43,7 +43,7 @@ export const BlogItem = props => {
|
||||
</div>
|
||||
|
||||
<div className='block'>
|
||||
<Link href={`${siteConfig('SUB_PATH')}/${post.slug}`} className='inline-block rounded-sm text-blue-600 text-xs dark:border-gray-800 border hover:text-red-400 transition-all duration-200 hover:border-red-300 h-9 leading-8 px-5'>
|
||||
<Link href={`${siteConfig('SUB_PATH', '')}/${post.slug}`} className='inline-block rounded-sm text-blue-600 text-xs dark:border-gray-800 border hover:text-red-400 transition-all duration-200 hover:border-red-300 h-9 leading-8 px-5'>
|
||||
Continue Reading <i className="fa-solid fa-angle-right align-middle"></i>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user