From eda51e4479212e10fdddfc56dd9918d319c71ff3 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 20 Jun 2023 15:56:53 +0800 Subject: [PATCH] =?UTF-8?q?simple=E4=B8=BB=E9=A2=98=20=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E4=BD=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/GoogleAdsense.js | 8 +++--- components/NotionPage.js | 3 -- public/css/theme-simple.css | 1 + themes/simple/LayoutBase.js | 3 +- themes/simple/LayoutSlug.js | 36 ++++++++++++++---------- themes/simple/components/ArticleInfo.js | 10 +++---- themes/simple/components/BlogItem.js | 6 ++-- themes/simple/components/BlogListPage.js | 14 +++++---- 8 files changed, 43 insertions(+), 38 deletions(-) diff --git a/components/GoogleAdsense.js b/components/GoogleAdsense.js index c6a80b2a..c2704313 100644 --- a/components/GoogleAdsense.js +++ b/components/GoogleAdsense.js @@ -45,7 +45,7 @@ const AdSlot = ({ type = 'show' }) => { data-ad-layout="in-article" data-ad-format="fluid" data-ad-client={BLOG.ADSENSE_GOOGLE_ID} - data-ad-slot="3806269138"> + data-ad-slot="3806269138" data-adtest="on"> } // 信息流广告 @@ -55,7 +55,7 @@ const AdSlot = ({ type = 'show' }) => { data-ad-layout-key="-5j+cz+30-f7+bf" style={{ display: 'block' }} data-ad-client={BLOG.ADSENSE_GOOGLE_ID} - data-ad-slot="1510444138"> + data-ad-slot="1510444138" data-adtest="on"> } // 原生广告 @@ -64,7 +64,7 @@ const AdSlot = ({ type = 'show' }) => { style={{ display: 'block', textAlign: 'center' }} data-ad-format="autorelaxed" data-ad-client={BLOG.ADSENSE_GOOGLE_ID} - data-ad-slot="4980048999"> + data-ad-slot="4980048999" data-adtest="on"> } // 展示广告 @@ -73,7 +73,7 @@ const AdSlot = ({ type = 'show' }) => { data-ad-client={BLOG.ADSENSE_GOOGLE_ID} data-ad-slot="8807314373" data-ad-format="auto" - data-full-width-responsive="true"> + data-full-width-responsive="true" data-adtest="on"> } export { AdSlot } diff --git a/components/NotionPage.js b/components/NotionPage.js index 76ed4f96..862af760 100644 --- a/components/NotionPage.js +++ b/components/NotionPage.js @@ -7,7 +7,6 @@ import TweetEmbed from 'react-tweet-embed' import 'katex/dist/katex.min.css' import { mapImgUrl } from '@/lib/notion/mapImage' -import { AdSlot } from './GoogleAdsense' const Code = dynamic(() => import('react-notion-x/build/third-party/code').then(async (m) => { @@ -80,8 +79,6 @@ const NotionPage = ({ post, className }) => { - - } diff --git a/public/css/theme-simple.css b/public/css/theme-simple.css index bc7b2896..d02b7661 100644 --- a/public/css/theme-simple.css +++ b/public/css/theme-simple.css @@ -29,5 +29,6 @@ #theme-simple .menu-link:hover { background-size: 100% 2px; color: #dd3333; + cursor: pointer; } diff --git a/themes/simple/LayoutBase.js b/themes/simple/LayoutBase.js index f0b7c20c..8946e07f 100644 --- a/themes/simple/LayoutBase.js +++ b/themes/simple/LayoutBase.js @@ -51,6 +51,7 @@ const LayoutBase = props => {
{onLoading ? LoadingCover : children} +
- -
diff --git a/themes/simple/LayoutSlug.js b/themes/simple/LayoutSlug.js index 4f6fc66f..4cc073a1 100644 --- a/themes/simple/LayoutSlug.js +++ b/themes/simple/LayoutSlug.js @@ -5,30 +5,36 @@ import { ArticleInfo } from './components/ArticleInfo' import Comment from '@/components/Comment' import ArticleAround from './components/ArticleAround' import ShareBar from '@/components/ShareBar' +import { AdSlot } from '@/components/GoogleAdsense' export const LayoutSlug = props => { const { post, lock, validPassword, prev, next } = props - if (!post) { - return - } - return ( - {lock && } + {lock && } - {!lock &&
+
- {post && <> - - - {/* 分享 */} - - {post.type === 'Post' && } - - } -
} + + +
+ +
+ + {!lock && } + + + +
+ +
+ + {post?.type === 'Post' && } + + +
) diff --git a/themes/simple/components/ArticleInfo.js b/themes/simple/components/ArticleInfo.js index 393c0f98..caec6e4c 100644 --- a/themes/simple/components/ArticleInfo.js +++ b/themes/simple/components/ArticleInfo.js @@ -15,15 +15,15 @@ export const ArticleInfo = (props) => {

- {post.title} + {post?.title}

{post?.type !== 'Page' && (<>
{BLOG.AUTHOR} - - {post.date?.start_date || post.createdTime} - {post.category && - {post.category}} - {post.tags && post.tags?.length > 0 && post.tags.map(t => / {t})} + - {post?.date?.start_date || post?.createdTime} + {post?.category && - {post?.category}} + {post?.tags && post.tags?.length > 0 && post?.tags.map(t => / {t})}
)} @@ -38,7 +38,7 @@ export const ArticleInfo = (props) => { | - {locale.COMMON.LAST_EDITED_TIME}: {post.lastEditedTime} + {locale.COMMON.LAST_EDITED_TIME}: {post?.lastEditedTime} | diff --git a/themes/simple/components/BlogItem.js b/themes/simple/components/BlogItem.js index 6dc715cb..6b61586b 100644 --- a/themes/simple/components/BlogItem.js +++ b/themes/simple/components/BlogItem.js @@ -6,12 +6,12 @@ import TwikooCommentCount from '@/components/TwikooCommentCount' export const BlogItem = props => { const { post } = props - return
+ return
{/* 文章标题 */}

{post.title} @@ -42,7 +42,7 @@ export const BlogItem = props => {

- + Continue Reading
diff --git a/themes/simple/components/BlogListPage.js b/themes/simple/components/BlogListPage.js index 7238e843..ea02a2b4 100644 --- a/themes/simple/components/BlogListPage.js +++ b/themes/simple/components/BlogListPage.js @@ -4,6 +4,7 @@ import { useRouter } from 'next/router' import Link from 'next/link' import { BlogItem } from './BlogItem' import { AdSlot } from '@/components/GoogleAdsense' +import { Fragment } from 'react' export const BlogListPage = props => { const { page = 1, posts, postCount } = props @@ -16,16 +17,17 @@ export const BlogListPage = props => { const pagePrefix = router.asPath.replace(/\/page\/[1-9]\d*/, '').replace(/\/$/, '') return ( -
+
- - {posts?.map(p => ( - - ))} + {posts?.map((p, index) => (<> + {(index + 1) % 3 === 0 && } + + ))} +
-
+