This commit is contained in:
tangly1024.com
2023-11-06 16:28:01 +08:00
parent ecf7825dad
commit a0b481eaca
137 changed files with 326 additions and 383 deletions

View File

@@ -1,4 +1,3 @@
import BLOG from '@/blog.config'
import BlogAround from './BlogAround'
import Comment from '@/components/Comment'
import RecommendPosts from './RecommendPosts'
@@ -23,7 +22,7 @@ import { siteConfig } from '@/lib/config'
*/
export default function ArticleDetail(props) {
const { post, recommendPosts, prev, next } = props
const url = BLOG.LINK + useRouter().asPath
const url = siteConfig('LINK') + useRouter().asPath
const { locale } = useGlobal()
const showArticleInfo = CONFIG.ARTICLE_INFO

View File

@@ -1,5 +1,5 @@
import { siteConfig } from '@/lib/config'
import Link from 'next/link'
import BLOG from '@/blog.config'
/**
* 博客归档列表
@@ -30,7 +30,7 @@ const BlogPostArchive = ({ posts = [], archiveTitle }) => {
<span className="text-gray-400">{post.date?.start_date}</span>{' '}
&nbsp;
<Link
href={`${BLOG.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">

View File

@@ -1,4 +1,3 @@
import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
import Image from 'next/image'
import Link from 'next/link'
@@ -9,6 +8,7 @@ import NotionPage from '@/components/NotionPage'
import NotionIcon from '@/components/NotionIcon'
import TwikooCommentCount from '@/components/TwikooCommentCount'
import { formatDateFmt } from '@/lib/formatDate'
import { siteConfig } from '@/lib/config'
const BlogPostCard = ({ post, showSummary }) => {
const { locale } = useGlobal()
@@ -21,7 +21,7 @@ const BlogPostCard = ({ post, showSummary }) => {
>
<div className="lg:p-8 p-4 flex flex-col w-full">
<Link
href={`${BLOG.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={`${BLOG.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={`${BLOG.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"

View File

@@ -1,7 +1,7 @@
import BlogPostCard from './BlogPostCard'
import PaginationNumber from './PaginationNumber'
import BLOG from '@/blog.config'
import BlogPostListEmpty from './BlogPostListEmpty'
import { siteConfig } from '@/lib/config'
/**
* 文章列表分页表格
@@ -12,7 +12,7 @@ import BlogPostListEmpty from './BlogPostListEmpty'
* @constructor
*/
const BlogPostListPage = ({ page = 1, posts = [], postCount }) => {
const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE)
const totalPage = Math.ceil(postCount / parseInt(siteConfig('POSTS_PER_PAGE')))
if (!posts || posts.length === 0) {
return <BlogPostListEmpty />

View File

@@ -1,10 +1,10 @@
import BLOG from '@/blog.config'
import BlogPostCard from './BlogPostCard'
import BlogPostListEmpty from './BlogPostListEmpty'
import { useGlobal } from '@/lib/global'
import throttle from 'lodash.throttle'
import { useCallback, useEffect, useRef, useState } from 'react'
import CONFIG from '../config'
import { siteConfig } from '@/lib/config'
/**
* 博客列表滚动分页
@@ -14,7 +14,7 @@ import CONFIG from '../config'
* @constructor
*/
const BlogPostListScroll = ({ posts = [], currentSearch, showSummary = CONFIG.POST_LIST_SUMMARY }) => {
const postsPerPage = BLOG.POSTS_PER_PAGE
const postsPerPage = parseInt(siteConfig('POSTS_PER_PAGE'))
const [page, updatePage] = useState(1)
const postsToShow = getPostByPage(page, posts, postsPerPage)

View File

@@ -1,5 +1,4 @@
import { siteConfig } from '@/lib/config'
import BLOG from '@/blog.config'
import DarkModeButton from '@/components/DarkModeButton'
const Footer = ({ title }) => {
@@ -16,9 +15,9 @@ const Footer = ({ title }) => {
<span>
<DarkModeButton />
<i className='fas fa-copyright' /> {`${copyrightDate}`} <span className='mx-1 animate-pulse'><i className='fas fa-heart' /></span> <a href={BLOG.LINK} className='underline font-bold '>{siteConfig('AUTHOR')}</a>.<br />
<i className='fas fa-copyright' /> {`${copyrightDate}`} <span className='mx-1 animate-pulse'><i className='fas fa-heart' /></span> <a href={siteConfig('LINK')} className='underline font-bold '>{siteConfig('AUTHOR')}</a>.<br />
{BLOG.BEI_AN && <><i className='fas fa-shield-alt' /> <a href='https://beian.miit.gov.cn/' className='mr-2'>{BLOG.BEI_AN}</a><br /></>}
{siteConfig('BEI_AN') && <><i className='fas fa-shield-alt' /> <a href='https://beian.miit.gov.cn/' className='mr-2'>{siteConfig('BEI_AN')}</a><br /></>}
<span className='hidden busuanzi_container_site_pv'>
<i className='fas fa-eye' /><span className='px-1 busuanzi_value_site_pv'> </span> </span>
@@ -26,7 +25,7 @@ const Footer = ({ title }) => {
<i className='fas fa-users' /> <span className='px-1 busuanzi_value_site_uv'> </span> </span>
<br />
<h1>{title}</h1>
<span className='text-xs font-serif text-gray-500 dark:text-gray-300 '>Powered by <a href='https://github.com/tangly1024/NotionNext' className='underline '>NotionNext {BLOG.VERSION}</a>.</span>
<span className='text-xs font-serif text-gray-500 dark:text-gray-300 '>Powered by <a href='https://github.com/tangly1024/NotionNext' className='underline '>NotionNext {siteConfig('VERSION')}</a>.</span>
</span>
</footer>
)

View File

@@ -1,4 +1,3 @@
import BLOG from '@/blog.config'
import LazyImage from '@/components/LazyImage'
import Router from 'next/router'
import SocialButton from './SocialButton'
@@ -12,7 +11,7 @@ const InfoCard = (props) => {
<LazyImage src={siteInfo?.icon} className='rounded-full' width={120} alt={siteConfig('AUTHOR')}/>
</div>
<div className='text-2xl font-serif dark:text-white py-2 hover:scale-105 transform duration-200'>{siteConfig('AUTHOR')}</div>
<div className='font-light dark:text-white py-2 hover:scale-105 transform duration-200 text-center'>{BLOG.BIO}</div>
<div className='font-light dark:text-white py-2 hover:scale-105 transform duration-200 text-center'>{siteConfig('BIO')}</div>
<SocialButton/>
</div>
</>

View File

@@ -1,4 +1,4 @@
import BLOG from '@/blog.config'
import { siteConfig } from '@/lib/config'
import { useGlobal } from '@/lib/global'
import Link from 'next/link'
import { useRouter } from 'next/router'
@@ -26,12 +26,12 @@ const LatestPostsGroup = ({ latestPosts }) => {
</div>
</div>
{latestPosts.map(post => {
const selected = currentPath === `${BLOG.SUB_PATH}/${post.slug}`
const selected = currentPath === `${siteConfig('SUB_PATH')}/${post.slug}`
return (
(<Link
key={post.id}
title={post.title}
href={`${BLOG.SUB_PATH}/${post.slug}`}
href={`${siteConfig('SUB_PATH')}/${post.slug}`}
passHref
className={'my-1 flex font-light'}>

View File

@@ -1,7 +1,7 @@
import { useEffect, useState } from 'react'
import BLOG from '@/blog.config'
import Link from 'next/link'
import { RecentComments } from '@waline/client'
import { siteConfig } from '@/lib/config'
/**
* @see https://waline.js.org/guide/get-started.html
@@ -13,7 +13,7 @@ const NextRecentComments = (props) => {
const [onLoading, changeLoading] = useState(true)
useEffect(() => {
RecentComments({
serverURL: BLOG.COMMENT_WALINE_SERVER_URL,
serverURL: siteConfig('COMMENT_WALINE_SERVER_URL'),
count: 5
}).then(({ comments }) => {
changeLoading(false)

View File

@@ -7,8 +7,8 @@ import Tabs from '@/components/Tabs'
import Logo from './Logo'
import Card from './Card'
import CONFIG from '../config'
import BLOG from '@/blog.config'
import Live2D from '@/components/Live2D'
import { siteConfig } from '@/lib/config'
/**
* 侧边平铺
@@ -23,7 +23,7 @@ const SideAreaLeft = props => {
const { post, slot, postCount } = props
const { locale } = useGlobal()
const showToc = post && post.toc && post.toc.length > 1
return <aside id='left' className={(BLOG.LAYOUT_SIDEBAR_REVERSE ? 'ml-4' : 'mr-4') + ' hidden lg:block flex-col w-60 z-20 relative'}>
return <aside id='left' className={(JSON.parse(siteConfig('LAYOUT_SIDEBAR_REVERSE')) ? 'ml-4' : 'mr-4') + ' hidden lg:block flex-col w-60 z-20 relative'}>
<section
className='w-60'>

View File

@@ -5,10 +5,10 @@ import CategoryGroup from './CategoryGroup'
import TagGroups from './TagGroups'
import CONFIG from '../config'
import { useRouter } from 'next/router'
import BLOG from '@/blog.config'
import dynamic from 'next/dynamic'
import Announcement from './Announcement'
import LatestPostsGroup from './LatestPostsGroup'
import { siteConfig } from '@/lib/config'
const NextRecentComments = dynamic(() => import('./NextRecentComments'))
/**
@@ -27,7 +27,7 @@ const SideAreaRight = (props) => {
const router = useRouter()
const announcementVisible = notice && Object.keys(notice).length > 0
return (<aside id='right' className={(BLOG.LAYOUT_SIDEBAR_REVERSE ? 'mr-4' : 'ml-4') + ' space-y-4 hidden xl:block flex-col w-60 relative z-10'}>
return (<aside id='right' className={(JSON.parse(siteConfig('LAYOUT_SIDEBAR_REVERSE')) ? 'mr-4' : 'ml-4') + ' space-y-4 hidden xl:block flex-col w-60 relative z-10'}>
{CONFIG.RIGHT_AD && <Card className='mb-2'>
{/* 展示广告 */}
@@ -92,7 +92,7 @@ const SideAreaRight = (props) => {
</Card>
)}
{BLOG.COMMENT_WALINE_SERVER_URL && BLOG.COMMENT_WALINE_RECENT && <Card>
{siteConfig('COMMENT_WALINE_SERVER_URL') && siteConfig('COMMENT_WALINE_RECENT') && <Card>
<div className="text-sm pb-1 px-2 flex flex-nowrap justify-between font-light dark:text-gray-200">
<div className="text-gray-600 dark:text-gray-200">
<i className="mr-2 fas fa-tag" />