万维广告支持

This commit is contained in:
tangly1024.com
2023-08-18 15:34:54 +08:00
parent 86c2bd636e
commit 72eb040083
8 changed files with 80 additions and 8 deletions

View File

@@ -62,7 +62,7 @@ const Catalog = ({ post }) => {
}
return <>
<div id='toc-wrapper' className='toc-wrapper overflow-y-auto max-h-96 overscroll-none scroll-hidden'>
<div id='toc-wrapper' className='toc-wrapper overflow-y-auto my-2 max-h-80 overscroll-none scroll-hidden'>
<nav className='h-full text-black'>
{toc.map((tocItem) => {
const id = uuidToId(tocItem.id)

View File

@@ -34,6 +34,8 @@ import CommonHead from '@/components/CommonHead'
import BlogArchiveItem from './components/BlogArchiveItem'
import BlogPostListPage from './components/BlogPostListPage'
import Link from 'next/link'
import dynamic from 'next/dynamic'
const WWAds = dynamic(() => import('@/components/WWAds'), { ssr: false })
// 主题全局变量
const ThemeGlobalGitbook = createContext()
@@ -92,6 +94,7 @@ const LayoutBase = (props) => {
<div id='container-inner' className='w-full px-7 max-w-3xl justify-center mx-auto'>
{slotTop}
<AdSlot type='in-article' />
<WWAds className='w-full'/>
<Transition
show={!onLoading}
@@ -107,7 +110,10 @@ const LayoutBase = (props) => {
{children}
</Transition>
{/* Google广告 */}
<AdSlot type='in-article' />
<WWAds className='w-full'/>
{/* 回顶按钮 */}
<JumpToTopButton />
</div>
@@ -126,8 +132,9 @@ const LayoutBase = (props) => {
<div className='py-14 px-6 sticky top-0'>
<ArticleInfo post={props?.post ? props?.post : props.notice} />
<div className='py-6'>
<div className='py-4'>
<Catalog {...props} />
<WWAds/>
{slotRight}
{router.route === '/' && <>
<InfoCard {...props} />
@@ -236,6 +243,7 @@ const LayoutSlug = (props) => {
{post?.type === 'Post' && <ArticleAround prev={prev} next={next} />}
<AdSlot />
<WWAds className='w-full'/>
<Comment frontMatter={post} />
</section>)}