mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-30 15:10:11 +00:00
配置文件整体重构
This commit is contained in:
@@ -3,28 +3,34 @@ import Link from 'next/link'
|
||||
|
||||
const CategoryGroup = ({ currentCategory, categories }) => {
|
||||
if (!categories || categories.length === 0) return <></>
|
||||
const categoryCount = siteConfig('PREVIEW_CATEGORY_COUNT')
|
||||
const categoryCount = siteConfig('NEXT_PREVIEW_CATEGORY_COUNT')
|
||||
const categoryOptions = categories.slice(0, categoryCount)
|
||||
return <>
|
||||
<div id='category-list' className='dark:border-gray-600 flex flex-wrap'>
|
||||
{categoryOptions.map(category => {
|
||||
const selected = currentCategory === category.name
|
||||
return (
|
||||
<Link
|
||||
key={category.name}
|
||||
href={`/category/${category.name}`}
|
||||
passHref
|
||||
className={(selected
|
||||
? 'hover:text-white dark:hover:text-white bg-gray-600 text-white '
|
||||
: 'dark:text-gray-400 text-gray-500 hover:text-white hover:bg-gray-500 dark:hover:text-white') +
|
||||
' text-sm w-full items-center duration-300 px-2 cursor-pointer py-1 font-light'}>
|
||||
|
||||
<i className={`${selected ? 'text-white fa-folder-open ' : 'text-gray-500 fa-folder '} mr-2 fas`} />{category.name}({category.count})
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</>;
|
||||
return (
|
||||
<>
|
||||
<div id='category-list' className='dark:border-gray-600 flex flex-wrap'>
|
||||
{categoryOptions.map(category => {
|
||||
const selected = currentCategory === category.name
|
||||
return (
|
||||
<Link
|
||||
key={category.name}
|
||||
href={`/category/${category.name}`}
|
||||
passHref
|
||||
className={
|
||||
(selected
|
||||
? 'hover:text-white dark:hover:text-white bg-gray-600 text-white '
|
||||
: 'dark:text-gray-400 text-gray-500 hover:text-white hover:bg-gray-500 dark:hover:text-white') +
|
||||
' text-sm w-full items-center duration-300 px-2 cursor-pointer py-1 font-light'
|
||||
}>
|
||||
<i
|
||||
className={`${selected ? 'text-white fa-folder-open ' : 'text-gray-500 fa-folder '} mr-2 fas`}
|
||||
/>
|
||||
{category.name}({category.count})
|
||||
</Link>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default CategoryGroup
|
||||
|
||||
@@ -11,16 +11,14 @@ import TagItemMini from './TagItemMini'
|
||||
const TagGroups = ({ tags, currentTag }) => {
|
||||
if (!tags || tags.length === 0) return <></>
|
||||
|
||||
const tagsCount = siteConfig('PREVIEW_TAG_COUNT')
|
||||
const tagsCount = siteConfig('NEXT_PREVIEW_TAG_COUNT')
|
||||
const tagOptions = tags.slice(0, tagsCount)
|
||||
return (
|
||||
<div id='tags-group' className='dark:border-gray-600 w-66 space-y-2'>
|
||||
{
|
||||
tagOptions.map(tag => {
|
||||
const selected = tag.name === currentTag
|
||||
return <TagItemMini key={tag.name} tag={tag} selected={selected} />
|
||||
})
|
||||
}
|
||||
{tagOptions.map(tag => {
|
||||
const selected = tag.name === currentTag
|
||||
return <TagItemMini key={tag.name} tag={tag} selected={selected} />
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
const CONFIG = {
|
||||
|
||||
NEXT_HOME_BANNER: true, // 首页是否显示大图及标语 [true,false]
|
||||
NEXT_HOME_BANNER_STRINGS: ['Hi,我是一个程序员', 'Hi,我是一个打工人', 'Hi,我是一个干饭人', '欢迎来到我的博客🎉'], // 首页大图标语文字
|
||||
NEXT_HOME_BANNER_STRINGS: [
|
||||
'Hi,我是一个程序员',
|
||||
'Hi,我是一个打工人',
|
||||
'Hi,我是一个干饭人',
|
||||
'欢迎来到我的博客🎉'
|
||||
], // 首页大图标语文字
|
||||
|
||||
NEXT_NAV_TYPE: 'normal', // ['fixed','autoCollapse','normal'] 分别是固定屏幕顶部并始终显示、固定屏幕顶部且滚动时隐藏,不固定屏幕顶部
|
||||
|
||||
@@ -9,6 +13,8 @@ const CONFIG = {
|
||||
NEXT_POST_LIST_PREVIEW: true, // 显示文章预览
|
||||
NEXT_POST_LIST_SUMMARY: false, // 显示用户自定义摘要,有预览时优先只展示预览
|
||||
|
||||
NEXT_PREVIEW_TAG_COUNT: 16, // 首页最多展示的标签数量,0为不限制
|
||||
NEXT_PREVIEW_CATEGORY_COUNT: 16, // 首页最多展示的分类数量,0为不限制
|
||||
NEXT_POST_HEADER_IMAGE_VISIBLE: false, // 文章详情页是否显示封面图
|
||||
|
||||
// 右侧组件
|
||||
@@ -33,7 +39,6 @@ const CONFIG = {
|
||||
NEXT_ARTICLE_RELATE_POSTS: true, // 相关文章推荐
|
||||
NEXT_ARTICLE_COPYRIGHT: true, // 文章版权声明
|
||||
NEXT_ARTICLE_INFO: true // 显示文章信息
|
||||
|
||||
}
|
||||
|
||||
export default CONFIG
|
||||
|
||||
Reference in New Issue
Block a user