mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-04 07:26:47 +00:00
fix. 评论插件;fukasawa广告组件
This commit is contained in:
@@ -63,6 +63,16 @@ const ValineComponent = dynamic(() => import('@/components/ValineComponent'), {
|
|||||||
const Comment = ({ siteInfo, frontMatter, className }) => {
|
const Comment = ({ siteInfo, frontMatter, className }) => {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
|
const COMMENT_ARTALK_SERVER = siteConfig('COMMENT_ARTALK_SERVER')
|
||||||
|
const COMMENT_TWIKOO_ENV_ID = siteConfig('COMMENT_TWIKOO_ENV_ID')
|
||||||
|
const COMMENT_WALINE_SERVER_URL = siteConfig('COMMENT_WALINE_SERVER_URL')
|
||||||
|
const COMMENT_VALINE_APP_ID = siteConfig('COMMENT_VALINE_APP_ID')
|
||||||
|
const COMMENT_GISCUS_REPO = siteConfig('COMMENT_GISCUS_REPO')
|
||||||
|
const COMMENT_CUSDIS_APP_ID = siteConfig('COMMENT_CUSDIS_APP_ID')
|
||||||
|
const COMMENT_UTTERRANCES_REPO = siteConfig('COMMENT_UTTERRANCES_REPO')
|
||||||
|
const COMMENT_GITALK_CLIENT_ID = siteConfig('COMMENT_GITALK_CLIENT_ID')
|
||||||
|
const COMMENT_WEBMENTION_ENABLE = siteConfig('COMMENT_WEBMENTION_ENABLE')
|
||||||
|
|
||||||
// 当连接中有特殊参数时跳转到评论区
|
// 当连接中有特殊参数时跳转到评论区
|
||||||
if (isBrowser && ('giscus' in router.query || router.query.target === 'comment')) {
|
if (isBrowser && ('giscus' in router.query || router.query.target === 'comment')) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -77,47 +87,47 @@ const Comment = ({ siteInfo, frontMatter, className }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={frontMatter?.id} id='comment' className={`comment mt-5 text-gray-800 dark:text-gray-300 ${className || ''}`}>
|
<div key={frontMatter?.id} id='comment' className={`comment mt-5 text-gray-800 dark:text-gray-300 ${className || ''}`}>
|
||||||
<Tabs>
|
<Tabs>
|
||||||
{siteConfig('COMMENT_ARTALK_SERVER') && (<div key='Artalk'>
|
{COMMENT_ARTALK_SERVER && (<div key='Artalk'>
|
||||||
<Artalk />
|
<Artalk />
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
||||||
{siteConfig('COMMENT_TWIKOO_ENV_ID') && (<div key='Twikoo'>
|
{COMMENT_TWIKOO_ENV_ID && (<div key='Twikoo'>
|
||||||
<TwikooCompenent />
|
<TwikooCompenent />
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
||||||
{siteConfig('COMMENT_WALINE_SERVER_URL') && (<div key='Waline'>
|
{COMMENT_WALINE_SERVER_URL && (<div key='Waline'>
|
||||||
<WalineComponent />
|
<WalineComponent />
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
||||||
{siteConfig('COMMENT_VALINE_APP_ID') && (<div key='Valine' name='reply'>
|
{COMMENT_VALINE_APP_ID && (<div key='Valine' name='reply'>
|
||||||
<ValineComponent path={frontMatter.id} />
|
<ValineComponent path={frontMatter.id} />
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
||||||
{siteConfig('COMMENT_GISCUS_REPO') && (
|
{COMMENT_GISCUS_REPO && (
|
||||||
<div key="Giscus">
|
<div key="Giscus">
|
||||||
<GiscusComponent className="px-2" />
|
<GiscusComponent className="px-2" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{siteConfig('COMMENT_CUSDIS_APP_ID') && (<div key='Cusdis'>
|
{COMMENT_CUSDIS_APP_ID && (<div key='Cusdis'>
|
||||||
<CusdisComponent frontMatter={frontMatter} />
|
<CusdisComponent frontMatter={frontMatter} />
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
||||||
{siteConfig('COMMENT_UTTERRANCES_REPO') && (<div key='Utterance'>
|
{COMMENT_UTTERRANCES_REPO && (<div key='Utterance'>
|
||||||
<UtterancesComponent issueTerm={frontMatter.id} className='px-2' />
|
<UtterancesComponent issueTerm={frontMatter.id} className='px-2' />
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
||||||
{siteConfig('COMMENT_GITALK_CLIENT_ID') && (<div key='GitTalk'>
|
{COMMENT_GITALK_CLIENT_ID && (<div key='GitTalk'>
|
||||||
<GitalkComponent frontMatter={frontMatter} />
|
<GitalkComponent frontMatter={frontMatter} />
|
||||||
</div>)}
|
</div>)}
|
||||||
|
|
||||||
{siteConfig('COMMENT_WEBMENTION_ENABLE') && (<div key='WebMention'>
|
{COMMENT_WEBMENTION_ENABLE && (<div key='WebMention'>
|
||||||
<WebMentionComponent frontMatter={frontMatter} className="px-2" />
|
<WebMentionComponent frontMatter={frontMatter} className="px-2" />
|
||||||
</div>)}
|
</div>)}
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const Tabs = ({ className, children }) => {
|
|||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
|
|
||||||
children = children.filter(c => c !== '')
|
children = children.filter(c => c && c !== '')
|
||||||
|
|
||||||
let count = 0
|
let count = 0
|
||||||
children.forEach(e => {
|
children.forEach(e => {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import ArticleAround from './ArticleAround'
|
|||||||
import { AdSlot } from '@/components/GoogleAdsense'
|
import { AdSlot } from '@/components/GoogleAdsense'
|
||||||
import LazyImage from '@/components/LazyImage'
|
import LazyImage from '@/components/LazyImage'
|
||||||
import { formatDateFmt } from '@/lib/formatDate'
|
import { formatDateFmt } from '@/lib/formatDate'
|
||||||
|
import WWAds from '@/components/WWAds'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -81,8 +82,7 @@ export default function ArticleDetail(props) {
|
|||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<AdSlot type='in-article'/>
|
<WWAds className='w-full' orientation='horizontal'/>
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Notion文章主体 */}
|
{/* Notion文章主体 */}
|
||||||
@@ -91,6 +91,7 @@ export default function ArticleDetail(props) {
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
|
<AdSlot type='in-article'/>
|
||||||
{/* 分享 */}
|
{/* 分享 */}
|
||||||
<ShareBar post={post} />
|
<ShareBar post={post} />
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { Style } from './style'
|
|||||||
import replaceSearchResult from '@/components/Mark'
|
import replaceSearchResult from '@/components/Mark'
|
||||||
import CommonHead from '@/components/CommonHead'
|
import CommonHead from '@/components/CommonHead'
|
||||||
import { siteConfig } from '@/lib/config'
|
import { siteConfig } from '@/lib/config'
|
||||||
|
import WWAds from '@/components/WWAds'
|
||||||
|
|
||||||
const Live2D = dynamic(() => import('@/components/Live2D'))
|
const Live2D = dynamic(() => import('@/components/Live2D'))
|
||||||
|
|
||||||
@@ -124,7 +125,10 @@ const LayoutIndex = (props) => {
|
|||||||
*/
|
*/
|
||||||
const LayoutPostList = (props) => {
|
const LayoutPostList = (props) => {
|
||||||
return <LayoutBase {...props}>
|
return <LayoutBase {...props}>
|
||||||
{siteConfig('POST_LIST_STYLE') === 'page' ? <BlogListPage {...props} /> : <BlogListScroll {...props} />}
|
|
||||||
|
<div className='w-full p-2'><WWAds className='w-full' orientation='horizontal'/></div>
|
||||||
|
|
||||||
|
{siteConfig('POST_LIST_STYLE') === 'page' ? <BlogListPage {...props} /> : <BlogListScroll {...props} />}
|
||||||
</LayoutBase>
|
</LayoutBase>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user