mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-23 07:26:47 +00:00
主题配置文件Notion化
This commit is contained in:
@@ -9,7 +9,7 @@ import TwikooCommentCount from '@/components/TwikooCommentCount'
|
||||
import LazyImage from '@/components/LazyImage'
|
||||
|
||||
const BlogPostCard = ({ post, showSummary }) => {
|
||||
const showPreview = CONFIG.POST_LIST_PREVIEW && post.blockMap
|
||||
const showPreview = siteConfig('MEDIUM_POST_LIST_PREVIEW', null, CONFIG) && post.blockMap
|
||||
const { locale } = useGlobal()
|
||||
return (
|
||||
<div
|
||||
@@ -29,7 +29,7 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
'cursor-pointer font-bold hover:underline text-3xl leading-tight text-gray-700 dark:text-gray-300 hover:text-green-500 dark:hover:text-green-400'
|
||||
}>
|
||||
<div>
|
||||
{CONFIG.POST_LIST_COVER && <div className='w-full max-h-96 object-cover overflow-hidden mb-2'>
|
||||
{siteConfig('MEDIUM_POST_LIST_COVER', null, CONFIG) && <div className='w-full max-h-96 object-cover overflow-hidden mb-2'>
|
||||
<LazyImage src={post.pageCoverThumbnail} style={post.pageCoverThumbnail ? {} : { height: '0px' }} className='w-full max-h-96 object-cover hover:scale-125 duration-150' />
|
||||
</div>}
|
||||
{post.title}
|
||||
@@ -43,8 +43,8 @@ const BlogPostCard = ({ post, showSummary }) => {
|
||||
}
|
||||
>
|
||||
<div className="text-sm py-1">{post.date?.start_date}</div>
|
||||
{CONFIG.POST_LIST_CATEGORY && <CategoryItem category={post.category} />}
|
||||
{CONFIG.POST_LIST_TAG && post?.tagItems?.map(tag => <TagItemMini key={tag.name} tag={tag} />)}
|
||||
{siteConfig('MEDIUM_POST_LIST_CATEGORY', null, CONFIG) && <CategoryItem category={post.category} />}
|
||||
{siteConfig('MEDIUM_POST_LIST_TAG', null, CONFIG) && post?.tagItems?.map(tag => <TagItemMini key={tag.name} tag={tag} />)}
|
||||
<TwikooCommentCount post={post} className='hover:underline'/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import CONFIG from '../config'
|
||||
import { siteConfig } from '@/lib/config'
|
||||
|
||||
/**
|
||||
* 跳转到网页顶部
|
||||
@@ -9,7 +10,7 @@ import CONFIG from '../config'
|
||||
* @constructor
|
||||
*/
|
||||
const JumpToTopButton = ({ showPercent = false, percent, className }) => {
|
||||
if (!CONFIG.WIDGET_TO_TOP) {
|
||||
if (!siteConfig('MEDIUM_WIDGET_TO_TOP', null, CONFIG)) {
|
||||
return <></>
|
||||
}
|
||||
return (
|
||||
|
||||
@@ -9,10 +9,10 @@ export const MenuBarMobile = (props) => {
|
||||
|
||||
let links = [
|
||||
// { name: locale.NAV.INDEX, to: '/' || '/', show: true },
|
||||
{ name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY },
|
||||
{ name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG },
|
||||
{ name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE }
|
||||
// { name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH }
|
||||
{ name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('MEDIUM_MENU_CATEGORY', null, CONFIG) },
|
||||
{ name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('MEDIUM_MENU_TAG', null, CONFIG) },
|
||||
{ name: locale.NAV.ARCHIVE, to: '/archive', show: siteConfig('MEDIUM_MENU_ARCHIVE', null, CONFIG) }
|
||||
// { name: locale.NAV.SEARCH, to: '/search', show: siteConfig('MENU_SEARCH', null, CONFIG) }
|
||||
]
|
||||
|
||||
if (customNav) {
|
||||
|
||||
@@ -20,10 +20,10 @@ export default function TopNavBar(props) {
|
||||
const { locale } = useGlobal()
|
||||
|
||||
const defaultLinks = [
|
||||
{ icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: CONFIG.MENU_CATEGORY },
|
||||
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: CONFIG.MENU_TAG },
|
||||
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: CONFIG.MENU_ARCHIVE },
|
||||
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: CONFIG.MENU_SEARCH }
|
||||
{ icon: 'fas fa-th', name: locale.COMMON.CATEGORY, to: '/category', show: siteConfig('MEDIUM_MENU_CATEGORY', null, CONFIG) },
|
||||
{ icon: 'fas fa-tag', name: locale.COMMON.TAGS, to: '/tag', show: siteConfig('MEDIUM_MENU_TAG', null, CONFIG) },
|
||||
{ icon: 'fas fa-archive', name: locale.NAV.ARCHIVE, to: '/archive', show: siteConfig('MEDIUM_MENU_ARCHIVE', null, CONFIG) },
|
||||
{ icon: 'fas fa-search', name: locale.NAV.SEARCH, to: '/search', show: siteConfig('MEDIUM_MENU_SEARCH', null, CONFIG) }
|
||||
]
|
||||
|
||||
let links = defaultLinks.concat(customNav)
|
||||
|
||||
Reference in New Issue
Block a user