部分配置siteConfig化

This commit is contained in:
tangly1024.com
2023-11-01 18:40:00 +08:00
parent 70f6413fb2
commit 52495e0200
80 changed files with 293 additions and 200 deletions

View File

@@ -3,6 +3,7 @@ import { useGlobal } from '@/lib/global'
import Link from 'next/link'
import React from 'react'
import throttle from 'lodash.throttle'
import { siteConfig } from '@/lib/config'
export const BlogListScroll = props => {
const { posts } = props
@@ -56,7 +57,7 @@ export const BlogListScroll = props => {
</h2>
<div className="mb-4 text-sm text-gray-700">
by <a href="#" className="text-gray-700">{BLOG.AUTHOR}</a> on {p.date?.start_date || p.createdTime}
by <a href="#" className="text-gray-700">{siteConfig('AUTHOR')}</a> on {p.date?.start_date || p.createdTime}
<span className="font-bold mx-1"> | </span>
<a href="#" className="text-gray-700">{p.category}</a>
<span className="font-bold mx-1"> | </span>

View File

@@ -1,5 +1,6 @@
import BLOG from '@/blog.config'
import Vercel from '@/components/Vercel'
import { siteConfig } from '@/lib/config'
export const Footer = (props) => {
const d = new Date()
@@ -15,7 +16,7 @@ export const Footer = (props) => {
return <footer className={'z-10 relative mt-6 flex-shrink-0 m-auto w-full text-gray-500 dark:text-gray-400 transition-all' } >
<div className="my-4 text-sm leading-6">
<div className="flex align-baseline justify-start flex-wrap space-x-6">
<div> © {BLOG.AUTHOR} {copyrightDate} </div>
<div> © {siteConfig('AUTHOR')} {copyrightDate} </div>
<div>Powered By <a href="https://github.com/tangly1024/NotionNext" className='underline'>NotionNext {BLOG.VERSION}</a></div>
<Vercel />
</div>

View File

@@ -3,6 +3,7 @@ import LazyImage from '@/components/LazyImage'
import Link from 'next/link'
import CONFIG from '../config'
import { SvgIcon } from './SvgIcon'
import { siteConfig } from '@/lib/config'
/**
* logo文字栏
@@ -16,7 +17,7 @@ export default function LogoBar(props) {
<Link href="/" aria-label={BLOG.title}>
<div className="h-6 w-6">
{CONFIG.NAV_NOTION_ICON
? <LazyImage src={siteInfo?.icon} className='rounded-full' width={24} height={24} alt={BLOG.AUTHOR} />
? <LazyImage src={siteInfo?.icon} className='rounded-full' width={24} height={24} alt={siteConfig('AUTHOR')} />
: <SvgIcon />}
</div>
</Link>
@@ -30,8 +31,8 @@ export default function LogoBar(props) {
)
: (
<p className="ml-2 font-medium text-gray-800 dark:text-gray-300 header-name">
<Link href="/" aria-label={BLOG.title}> {siteInfo?.title}</Link>
{' '}<span className="font-normal text-sm text-gray-00 dark:text-gray-400">{siteInfo?.description}</span>
<Link href="/" aria-label={BLOG.title}> {siteConfig('TITLE')}</Link>
{' '}<span className="font-normal text-sm text-gray-00 dark:text-gray-400">{siteConfig('HOME_BANNER_IMAGE')}</span>
</p>
)}
</div>

View File

@@ -8,11 +8,12 @@ import { MenuItemDrop } from './MenuItemDrop'
import Collapse from '@/components/Collapse'
import { MenuItemCollapse } from './MenuItemCollapse'
import LazyImage from '@/components/LazyImage'
import { siteConfig } from '@/lib/config'
const Header = props => {
const { fullWidth, siteInfo } = props
const title = siteInfo?.title
const title = siteConfig('TITLE')
return <div className='md:hidden fixed top-0 w-full z-20'>
<div id="sticky-nav"
@@ -23,12 +24,12 @@ const Header = props => {
<div className="h-6 w-6">
{/* <SvgIcon/> */}
{CONFIG.NAV_NOTION_ICON
? <LazyImage src={siteInfo?.icon} width={24} height={24} alt={BLOG.AUTHOR} />
? <LazyImage src={siteInfo?.icon} width={24} height={24} alt={siteConfig('AUTHOR')} />
: <SvgIcon />}
</div>
<p className="ml-2 font-medium text-gray-800 dark:text-gray-300 header-name">
{title} {/* ,{' '}<span className="font-normal">{siteInfo?.description}</span> */}
{title} {/* ,{' '}<span className="font-normal">{siteConfig('HOME_BANNER_IMAGE')}</span> */}
</p>
</>
</Link>

View File

@@ -3,6 +3,7 @@ import { Dialog, Transition } from '@headlessui/react'
import { Footer } from './Footer'
import SocialButton from './SocialButton'
import BLOG from '@/blog.config'
import { siteConfig } from '@/lib/config'
/**
* 侧拉抽屉
@@ -61,7 +62,7 @@ export default function SlideOvers({ children, cRef }) {
leaveTo="opacity-0 transition-y-32"
>
<div className='max-w-7xl mx-auto space-y-6'>
<h2 className='text-4xl text-gray-200'>关于{BLOG.AUTHOR}</h2>
<h2 className='text-4xl text-gray-200'>关于{siteConfig('AUTHOR')}</h2>
<h2 className='text-2xl text-gray-400'>{BLOG.BIO}</h2>
<h2 className='text-4xl text-gray-200'>联系我</h2>
<SocialButton/>

View File

@@ -1,4 +1,4 @@
import BLOG from '@/blog.config'
import { siteConfig } from '@/lib/config'
/**
* 标题栏
@@ -6,9 +6,9 @@ import BLOG from '@/blog.config'
* @returns
*/
export const Title = (props) => {
const { siteInfo, post } = props
const title = post?.title || siteInfo?.description
const description = post?.description || BLOG.AUTHOR
const { post } = props
const title = post?.title || siteConfig('HOME_BANNER_IMAGE')
const description = post?.description || siteConfig('AUTHOR')
return <div className="text-center px-6 py-12 mb-6 bg-gray-100 dark:bg-hexo-black-gray dark:border-hexo-black-gray border-b">
<h1 className=" text-xl md:text-4xl pb-4">{title}</h1>