整理主题配置文件

This commit is contained in:
tangly1024.com
2023-07-06 12:24:25 +08:00
parent b27e62b293
commit 46b9ea1ba2
31 changed files with 99 additions and 96 deletions

View File

@@ -3,7 +3,7 @@ import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
import { useRouter } from 'next/router'
import Link from 'next/link'
import CONFIG_EXAMPLE from '../config_example'
import CONFIG from '../config'
import BlogPostCard from './BlogPostCard'
export const BlogListPage = props => {
@@ -17,7 +17,7 @@ export const BlogListPage = props => {
const showNext = page < totalPage
const pagePrefix = router.asPath.split('?')[0].replace(/\/page\/[1-9]\d*/, '').replace(/\/$/, '')
const showPageCover = CONFIG_EXAMPLE.POST_LIST_COVER
const showPageCover = CONFIG.POST_LIST_COVER
return (
<div className={`w-full ${showPageCover ? 'md:pr-2' : 'md:pr-12'} mb-12`}>

View File

@@ -3,7 +3,7 @@ import { useGlobal } from '@/lib/global'
import React, { useEffect } from 'react'
import throttle from 'lodash.throttle'
import BlogPostCard from './BlogPostCard'
import CONFIG_EXAMPLE from '../config_example'
import CONFIG from '../config'
export const BlogListScroll = props => {
const { posts } = props
@@ -35,7 +35,7 @@ export const BlogListScroll = props => {
handleGetMore()
}
}, 500))
const showPageCover = CONFIG_EXAMPLE.POST_LIST_COVER
const showPageCover = CONFIG.POST_LIST_COVER
useEffect(() => {
window.addEventListener('scroll', scrollTrigger)

View File

@@ -1,10 +1,10 @@
import BLOG from '@/blog.config'
import CONFIG_EXAMPLE from '../config_example'
import CONFIG from '../config'
import Link from 'next/link'
import TwikooCommentCount from '@/components/TwikooCommentCount'
const BlogPostCard = ({ post }) => {
const showPageCover = CONFIG_EXAMPLE.POST_LIST_COVER && post?.pageCoverThumbnail
const showPageCover = CONFIG.POST_LIST_COVER && post?.pageCoverThumbnail
return <article className={`${showPageCover ? 'flex md:flex-row flex-col-reverse' : ''} replace mb-12 `}>
<div className={`${showPageCover ? 'md:w-7/12' : ''}`}>

View File

@@ -1,6 +1,6 @@
import BLOG from '@/blog.config'
import { useGlobal } from '@/lib/global'
import CONFIG_EXAMPLE from '../config_example'
import CONFIG from '../config'
import { MenuItemDrop } from './MenuItemDrop'
/**
@@ -13,10 +13,10 @@ export const Nav = (props) => {
const { locale } = useGlobal()
let links = [
{ id: 1, icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG_EXAMPLE.MENU_SEARCH },
{ id: 2, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG_EXAMPLE.MENU_ARCHIVE },
{ id: 3, icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG_EXAMPLE.MENU_CATEGORY },
{ id: 4, icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG_EXAMPLE.MENU_TAG }
{ id: 1, icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH },
{ id: 2, icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE },
{ id: 3, icon: 'fas fa-folder', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY },
{ id: 4, icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG }
]
if (customNav) {