Merge branch 'main' into feat/mail-encypt

This commit is contained in:
tangly1024
2025-07-27 21:24:37 +08:00
committed by GitHub
390 changed files with 4508 additions and 1516 deletions

View File

@@ -1,4 +1,4 @@
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
/**
* 归档分组文章
@@ -21,12 +21,12 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
<div id={post?.publishDay}>
<span className='text-gray-400'>{post.date?.start_date}</span>{' '}
&nbsp;
<Link
<SmartLink
href={post?.href}
passHref
className='dark:text-gray-400 dark:hover:text-gray-300 overflow-x-hidden hover:underline cursor-pointer text-gray-600'>
{post.title}
</Link>
</SmartLink>
</div>
</li>
)

View File

@@ -1,6 +1,6 @@
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { useRouter } from 'next/router'
import { useEffect, useRef } from 'react'
import BlogPost from './BlogPost'
@@ -64,7 +64,7 @@ export const BlogListPage = props => {
</div>
<div className='flex justify-between text-xs'>
<Link
<SmartLink
href={{
pathname:
currentPage - 1 === 1
@@ -76,8 +76,8 @@ export const BlogListPage = props => {
<button rel='prev' className='block cursor-pointer'>
{locale.PAGINATION.PREV}
</button>
</Link>
<Link
</SmartLink>
<SmartLink
href={{
pathname: `${pagePrefix}/page/${currentPage + 1}`,
query: router.query.s ? { s: router.query.s } : {}
@@ -86,7 +86,7 @@ export const BlogListPage = props => {
<button rel='next' className='block cursor-pointer'>
{locale.PAGINATION.NEXT}
</button>
</Link>
</SmartLink>
</div>
</div>
)

View File

@@ -1,7 +1,7 @@
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import throttle from 'lodash.throttle'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { useCallback, useEffect, useRef, useState } from 'react'
export const BlogListScroll = props => {
@@ -59,11 +59,11 @@ export const BlogListScroll = props => {
{postsToShow.map(p => (
<article key={p.id} className='mb-12'>
<h2 className='mb-4'>
<Link
<SmartLink
href={`/${p.slug}`}
className='text-black text-xl md:text-2xl no-underline hover:underline'>
{p.title}
</Link>
</SmartLink>
</h2>
<div className='mb-4 text-sm text-gray-700'>

View File

@@ -1,5 +1,5 @@
import { compressImage } from '@/lib/notion/mapImage'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { usePlogGlobal } from '..'
import { isMobile } from '@/lib/utils'
import LazyImage from '@/components/LazyImage'
@@ -42,9 +42,9 @@ const BlogPost = (props) => {
{siteConfig('POST_TITLE_ICON') && <NotionIcon icon={post.pageIcon} />} {post?.title}
</h2>
{post?.category && <div className='text-xs rounded-lg absolute left-0 top-0 m-4 px-2 py-1 bg-gray-200 dark:bg-black dark:bg-opacity-25 hover:bg-blue-700 hover:text-white duration-200'>
<Link href={`/category/${post?.category}`}>
<SmartLink href={`/category/${post?.category}`}>
{post?.category}
</Link>
</SmartLink>
</div>}
</article>

View File

@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { RecentComments } from '@waline/client'
import { siteConfig } from '@/lib/config'
@@ -26,7 +26,7 @@ const ExampleRecentComments = (props) => {
{!onLoading && comments && comments.length === 0 && <div>No Comments</div>}
{!onLoading && comments && comments.length > 0 && comments.map((comment) => <div key={comment.objectId} className='pb-2'>
<div className='dark:text-gray-300 text-gray-600 text-xs waline-recent-content wl-content' dangerouslySetInnerHTML={{ __html: comment.comment }} />
<div className='dark:text-gray-400 text-gray-400 text-sm text-right cursor-pointer hover:text-red-500 hover:underline pt-1'><Link href={{ pathname: comment.url, hash: comment.objectId, query: { target: 'comment' } }}>--{comment.nick}</Link></div>
<div className='dark:text-gray-400 text-gray-400 text-sm text-right cursor-pointer hover:text-red-500 hover:underline pt-1'><SmartLink href={{ pathname: comment.url, hash: comment.objectId, query: { target: 'comment' } }}>--{comment.nick}</SmartLink></div>
</div>)}
</>

View File

@@ -1,5 +1,5 @@
import LazyImage from '@/components/LazyImage'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import CONFIG from '../config'
import { SvgIcon } from './SvgIcon'
import { siteConfig } from '@/lib/config'
@@ -13,24 +13,24 @@ export default function LogoBar(props) {
const { navBarTitle, siteInfo } = props
return <div className="flex items-center">
<Link href="/" aria-label={siteConfig('title')}>
<SmartLink href="/" aria-label={siteConfig('title')}>
<div className="h-6 w-6">
{siteConfig('NOBELIUM_NAV_NOTION_ICON', null, CONFIG)
? <LazyImage src={siteInfo?.icon} className='rounded-full' width={24} height={24} alt={siteConfig('AUTHOR')} />
: <SvgIcon />}
</div>
</Link>
</SmartLink>
{navBarTitle
? (
<Link href="/" aria-label={siteConfig('title')}>
<SmartLink href="/" aria-label={siteConfig('title')}>
<p className="ml-2 font-medium text-gray-800 dark:text-gray-300 header-name">
{navBarTitle}
</p>
</Link>
</SmartLink>
)
: (
<p className="ml-2 font-medium text-gray-800 dark:text-gray-300 header-name">
<Link href="/" aria-label={siteConfig('TITLE')}> {siteConfig('TITLE')}</Link>
<SmartLink href="/" aria-label={siteConfig('TITLE')}> {siteConfig('TITLE')}</SmartLink>
{' '}<span className="font-normal text-sm text-gray-00 dark:text-gray-400">{siteConfig('DESCRIPTION')}</span>
</p>
)}

View File

@@ -1,5 +1,5 @@
import Collapse from '@/components/Collapse'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { useState } from 'react'
/**
@@ -32,7 +32,7 @@ export const MenuItemCollapse = props => {
className='w-full px-4 py-2 text-left dark:bg-hexo-black-gray dark:border-black'
onClick={toggleShow}>
{!hasSubMenu && (
<Link
<SmartLink
href={link?.href}
target={link?.target}
className='font-extralight flex justify-between pl-2 pr-4 dark:text-gray-200 no-underline tracking-widest pb-1'>
@@ -44,7 +44,7 @@ export const MenuItemCollapse = props => {
)}
{link?.name}
</span>
</Link>
</SmartLink>
)}
{hasSubMenu && (
<div
@@ -71,9 +71,9 @@ export const MenuItemCollapse = props => {
<div
key={index}
className='font-extralight dark:bg-black text-left px-10 justify-start bg-gray-50 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 border-b dark:border-gray-800 py-3 pr-6'>
<Link href={sLink.href} target={link?.target}>
<SmartLink href={sLink.href} target={link?.target}>
<span className='text-xs'>{sLink.title}</span>
</Link>
</SmartLink>
</div>
)
})}

View File

@@ -1,4 +1,4 @@
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { useState } from 'react'
export const MenuItemDrop = ({ link }) => {
@@ -16,9 +16,9 @@ export const MenuItemDrop = ({ link }) => {
onMouseLeave={() => changeShow(false)}>
{!hasSubMenu && (
<div className='block text-black dark:text-gray-50 nav'>
<Link href={link?.href} target={link?.target}>
<SmartLink href={link?.href} target={link?.target}>
{link?.icon && <i className={link?.icon} />} {link?.name}
</Link>
</SmartLink>
</div>
)}
@@ -39,12 +39,12 @@ export const MenuItemDrop = ({ link }) => {
<li
key={index}
className='text-gray-700 dark:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-900 tracking-widest transition-all duration-200 dark:border-gray-800 py-3 pr-6 pl-3'>
<Link href={sLink.href} target={link?.target}>
<SmartLink href={sLink.href} target={link?.target}>
<span className='text-sm text-nowrap font-extralight'>
{link?.icon && <i className={sLink?.icon}> &nbsp; </i>}
{sLink.title}
</span>
</Link>
</SmartLink>
</li>
)
})}

View File

@@ -2,7 +2,7 @@ import { ArrowPath, ChevronLeft, ChevronRight } from '@/components/HeroIcons'
import LazyImage from '@/components/LazyImage'
import { compressImage } from '@/lib/notion/mapImage'
import { Dialog, Transition } from '@headlessui/react'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { Fragment, useRef, useState } from 'react'
import { usePlogGlobal } from '..'
@@ -105,7 +105,7 @@ export default function Modal(props) {
{/* </div> */}
<Link href={modalContent?.href}>
<SmartLink href={modalContent?.href}>
<LazyImage
onLoad={handleImageLoad}
placeholderSrc={thumbnail}
@@ -113,7 +113,7 @@ export default function Modal(props) {
ref={imgRef}
className={`w-full select-none max-w-7xl max-h-[90vh] shadow-xl animate__animated animate__fadeIn'`}
/>
</Link>
</SmartLink>
<>
<div className='absolute bottom-0 left-0 m-4 z-20'>
@@ -134,11 +134,11 @@ export default function Modal(props) {
{modalContent?.category && (
<div className='flex'>
<Link
<SmartLink
href={`/category/${modalContent?.category}`}
className='text-xs rounded-lg mt-3 px-2 py-1 bg-black bg-opacity-20 text-white hover:bg-blue-700 hover:text-white duration-200'>
{modalContent?.category}
</Link>
</SmartLink>
</div>
)}
</div>

View File

@@ -2,7 +2,7 @@ import Collapse from '@/components/Collapse'
import LazyImage from '@/components/LazyImage'
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import { useRef, useState } from 'react'
import CONFIG from '../config'
import { MenuItemCollapse } from './MenuItemCollapse'
@@ -21,7 +21,7 @@ const Header = props => {
className={`sticky-nav m-auto w-full h-6 flex flex-row justify-between items-center mb-2 md:mb-12 py-8 glassmorphism ${
!fullWidth ? 'max-w-3xl px-4' : 'px-4 md:px-24'
}`}>
<Link
<SmartLink
href='/'
aria-label={siteConfig('title')}
className='flex items-center'>
@@ -44,7 +44,7 @@ const Header = props => {
{/* ,{' '}<span className="font-normal">{siteConfig('HOME_BANNER_IMAGE')}</span> */}
</p>
</>
</Link>
</SmartLink>
<NavBar {...props} />
</div>

View File

@@ -1,6 +1,6 @@
import Live2D from '@/components/Live2D'
import { useGlobal } from '@/lib/global'
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
import dynamic from 'next/dynamic'
import { siteConfig } from '@/lib/config'
@@ -19,13 +19,13 @@ export const SideBar = (props) => {
<ul className="list-reset leading-normal">
{categories?.map(category => {
return (
<Link
<SmartLink
key={category.name}
href={`/category/${category.name}`}
passHref
legacyBehavior>
<li> <a href="#" className="text-gray-darkest text-sm">{category.name}({category.count})</a></li>
</Link>
</SmartLink>
);
})}
</ul>
@@ -40,9 +40,9 @@ export const SideBar = (props) => {
<ul className="list-reset leading-normal">
{latestPosts?.map(p => {
return (
<Link key={p.id} href={`/${p.slug}`} passHref legacyBehavior>
<SmartLink key={p.id} href={`/${p.slug}`} passHref legacyBehavior>
<li> <a href="#" className="text-gray-darkest text-sm">{p.title}</a></li>
</Link>
</SmartLink>
);
})}
</ul>

View File

@@ -1,13 +1,13 @@
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
const TagItem = ({ tag }) => (
(<Link href={`/tag/${encodeURIComponent(tag)}`}>
(<SmartLink href={`/tag/${encodeURIComponent(tag)}`}>
<p className="mr-1 rounded-full px-2 py-1 border leading-none text-sm dark:border-gray-600">
{tag}
</p>
</Link>)
</SmartLink>)
)
export default TagItem

View File

@@ -1,4 +1,4 @@
import Link from 'next/link'
import SmartLink from '@/components/SmartLink'
const Tags = props => {
const { tagOptions, tag } = props
@@ -19,14 +19,14 @@ const Tags = props => {
: 'bg-gray-100 border-gray-100 text-gray-400 dark:bg-night dark:border-gray-800'
}`}
>
<Link
<SmartLink
key={tag.id}
href={selected ? '/search' : `/tag/${encodeURIComponent(tag.name)}`}
className="px-4 py-2 block">
{`${tag.name} (${tag.count})`}
</Link>
</SmartLink>
</li>
)
})}