mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-07 23:16:52 +00:00
feature: 配置文件整理
This commit is contained in:
@@ -3,6 +3,7 @@ import dynamic from 'next/dynamic'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useGlobal } from '@/lib/global'
|
||||
import 'gitalk/dist/gitalk.css'
|
||||
import Tabs from '@/components/Tabs'
|
||||
|
||||
const GitalkComponent = dynamic(
|
||||
() => {
|
||||
@@ -28,44 +29,44 @@ const Comment = ({ frontMatter }) => {
|
||||
const { theme } = useGlobal()
|
||||
|
||||
return (
|
||||
BLOG.comment.provider !== '' && (
|
||||
<div className='comment mt-5 text-gray-800 dark:text-gray-300'>
|
||||
{BLOG.comment.provider === 'gitalk' && (<div className='m-10'>
|
||||
<div className='comment mt-5 text-gray-800 dark:text-gray-300'>
|
||||
<Tabs>
|
||||
{BLOG.COMMENT_GITALK_CLIENT_ID && (<div className='m-10' key='gitalk'>
|
||||
<GitalkComponent
|
||||
options={{
|
||||
id: frontMatter.id,
|
||||
title: frontMatter.title,
|
||||
clientID: BLOG.comment.gitalkConfig.clientID,
|
||||
clientSecret: BLOG.comment.gitalkConfig.clientSecret,
|
||||
repo: BLOG.comment.gitalkConfig.repo,
|
||||
owner: BLOG.comment.gitalkConfig.owner,
|
||||
admin: BLOG.comment.gitalkConfig.admin,
|
||||
distractionFreeMode: BLOG.comment.gitalkConfig.distractionFreeMode
|
||||
clientID: BLOG.COMMENT_GITALK_CLIENT_ID,
|
||||
clientSecret: BLOG.COMMENT_GITALK_CLIENT_SECRET,
|
||||
repo: BLOG.COMMENT_GITALK_REPO,
|
||||
owner: BLOG.COMMENT_GITALK_OWNER,
|
||||
admin: BLOG.COMMENT_GITALK_ADMIN.split(','),
|
||||
distractionFreeMode: BLOG.COMMENT_GITALK_DISTRACTION_FREE_MODE
|
||||
}}
|
||||
/>
|
||||
</div>)}
|
||||
{BLOG.comment.provider === 'utterances' && (<div className='m-10'>
|
||||
<UtterancesComponent issueTerm={frontMatter.id} className='px-2' />
|
||||
</div>
|
||||
{BLOG.COMMENT_UTTERRANCES_REPO && (<div className='m-10' key='utterance'>
|
||||
<UtterancesComponent issueTerm={frontMatter.id} className='px-2' />
|
||||
</div>
|
||||
)}
|
||||
{BLOG.comment.provider === 'cusdis' && (<>
|
||||
{BLOG.COMMENT_CUSDIS_APP_ID && (<>
|
||||
<script defer src='https://cusdis.com/js/widget/lang/zh-cn.js' />
|
||||
<div className='m-10'>
|
||||
<div className='m-10' key='cusdis'>
|
||||
<CusdisComponent
|
||||
attrs={{
|
||||
host: BLOG.comment.cusdisConfig.host,
|
||||
appId: BLOG.comment.cusdisConfig.appId,
|
||||
host: BLOG.COMMENT_CUSDIS_HOST,
|
||||
appId: BLOG.COMMENT_CUSDIS_APP_ID,
|
||||
pageId: frontMatter.id,
|
||||
pageTitle: frontMatter.title,
|
||||
pageUrl: BLOG.link + router.asPath,
|
||||
pageUrl: BLOG.LINK + router.asPath,
|
||||
theme: theme
|
||||
}}
|
||||
lang={BLOG.lang.toLowerCase()}
|
||||
lang={BLOG.LANG.toLowerCase()}
|
||||
/>
|
||||
</div>
|
||||
</>)}
|
||||
</div>
|
||||
)
|
||||
</Tabs>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user