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,4 @@
import BLOG from '@/blog.config'
import { siteConfig } from '@/lib/config'
import Link from 'next/link'
/**
@@ -25,7 +25,7 @@ export default function BlogArchiveItem({ archiveTitle, archivePosts }) {
</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 Link from 'next/link'
import CONFIG from '../config'
import TwikooCommentCount from '@/components/TwikooCommentCount'
@@ -13,7 +12,7 @@ export const BlogItem = props => {
<h2 className="mb-2">
<Link
href={`${BLOG.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>
@@ -44,7 +43,7 @@ export const BlogItem = props => {
</div>
<div className='block'>
<Link href={`${BLOG.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>

View File

@@ -1,14 +1,14 @@
import BLOG from '@/blog.config'
import { useRouter } from 'next/router'
import Link from 'next/link'
import { BlogItem } from './BlogItem'
import { AdSlot } from '@/components/GoogleAdsense'
import { siteConfig } from '@/lib/config'
export const BlogListPage = props => {
const { page = 1, posts, postCount } = props
const router = useRouter()
const totalPage = Math.ceil(postCount / BLOG.POSTS_PER_PAGE)
const totalPage = Math.ceil(postCount / parseInt(siteConfig('POSTS_PER_PAGE')))
const currentPage = +page
const showPrev = currentPage > 1

View File

@@ -1,8 +1,8 @@
import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
import { useCallback, useEffect, useRef, useState } from 'react'
import throttle from 'lodash.throttle'
import { BlogItem } from './BlogItem'
import { siteConfig } from '@/lib/config'
export const BlogListScroll = props => {
const { posts } = props
@@ -12,12 +12,12 @@ export const BlogListScroll = props => {
let hasMore = false
const postsToShow = posts
? Object.assign(posts).slice(0, BLOG.POSTS_PER_PAGE * page)
? Object.assign(posts).slice(0, parseInt(siteConfig('POSTS_PER_PAGE')) * page)
: []
if (posts) {
const totalCount = posts.length
hasMore = page * BLOG.POSTS_PER_PAGE < totalCount
hasMore = page * parseInt(siteConfig('POSTS_PER_PAGE')) < totalCount
}
const handleGetMore = () => {
if (!hasMore) return

View File

@@ -1,7 +1,7 @@
import BLOG from '@/blog.config'
import Link from 'next/link'
import { RecentComments } from '@waline/client'
import { useEffect, useState } from 'react'
import { siteConfig } from '@/lib/config'
/**
* @see https://waline.js.org/guide/get-started.html
@@ -13,7 +13,7 @@ const ExampleRecentComments = (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

@@ -1,4 +1,3 @@
import BLOG from '@/blog.config'
import DarkModeButton from '@/components/DarkModeButton'
import { siteConfig } from '@/lib/config'
@@ -16,10 +15,10 @@ export const Footer = (props) => {
<div className="md:p-0 text-center md:text-right text-xs">
{/* 右侧链接 */}
{/* <a href="#" className="text-black no-underline hover:underline">Privacy Policy</a> */}
{BLOG.BEI_AN && (<a href="https://beian.miit.gov.cn/" className="text-black dark:text-gray-200 no-underline hover:underline ml-4">{BLOG.BEI_AN} </a>)}
{siteConfig('BEI_AN') && (<a href="https://beian.miit.gov.cn/" className="text-black dark:text-gray-200 no-underline hover:underline ml-4">{siteConfig('BEI_AN')} </a>)}
<span className='no-underline ml-4'>
Powered by
<a href="https://github.com/tangly1024/NotionNext" className=' hover:underline'> NotionNext {BLOG.VERSION} </a>
<a href="https://github.com/tangly1024/NotionNext" className=' hover:underline'> NotionNext {siteConfig('VERSION')} </a>
</span>
</div>
</div>

View File

@@ -1,4 +1,3 @@
import BLOG from '@/blog.config'
import LazyImage from '@/components/LazyImage'
import Link from 'next/link'
import CONFIG from '../config'
@@ -11,7 +10,7 @@ import { siteConfig } from '@/lib/config'
*/
export const Header = (props) => {
const { siteInfo } = props
const avatar = siteInfo?.icon || BLOG.AVATAR
const avatar = siteInfo?.icon || siteConfig('AVATAR')
return (
<header className="text-center justify-between items-center px-6 bg-white h-80 dark:bg-black relative z-10">