From 5bc16903c5a9a6740789e2ad573e57705efb1d0b Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Wed, 15 Dec 2021 17:51:24 +0800 Subject: [PATCH] =?UTF-8?q?google=E7=BB=9F=E8=AE=A1=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 2 +- components/BlogPostCard.js | 2 +- components/ThirdPartyScript.js | 39 +++++++++++++++++++++++++++++----- pages/_app.js | 7 +++--- pages/article/[slug].js | 10 +++++++-- 5 files changed, 48 insertions(+), 12 deletions(-) diff --git a/blog.config.js b/blog.config.js index 45f9a626..7e9f8d3e 100644 --- a/blog.config.js +++ b/blog.config.js @@ -32,7 +32,7 @@ const BLOG = { domainId: '' // e.g '0e2257a8-54d4-4847-91a1-0311ea48cc7b' }, gaConfig: { - measurementId: 'G-5EV4HZD0XX' // e.g: G-XXXXXXXXXX + measurementId: 'G-68EK0W049N' // e.g: G-XXXXXXXXXX }, baiduAnalytics: 'f683ef76f06bb187cbed5546f6f28f28', // e.g only need xxxxx -> https://hm.baidu.com/hm.js?[xxxxx] busuanzi: true, // see http://busuanzi.ibruce.info/ diff --git a/components/BlogPostCard.js b/components/BlogPostCard.js index 9f72d1bd..ccce55fa 100644 --- a/components/BlogPostCard.js +++ b/components/BlogPostCard.js @@ -11,7 +11,7 @@ const BlogPostCard = ({ post, tags }) => {
-
+
1) ? post.page_cover : BLOG.defaultImgCover} alt={post.title} layout='fill' objectFit='cover' loading='lazy' />
diff --git a/components/ThirdPartyScript.js b/components/ThirdPartyScript.js index 34d369a6..2e994a5c 100644 --- a/components/ThirdPartyScript.js +++ b/components/ThirdPartyScript.js @@ -35,11 +35,6 @@ const ThirdPartyScript = () => { {/* 代码统计 */} {BLOG.isProd && (<> - {/* GoogleAdsense */} - {BLOG.googleAdsenseId && ( - + {/* 信息流 */} + + {/* 展示广告 */} + + {/* 文章内嵌广告 */} + + + + )} )} ) } diff --git a/pages/_app.js b/pages/_app.js index dec496ff..25dd8726 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,8 +1,9 @@ -import 'rc-dropdown/assets/index.css' -import 'katex/dist/katex.min.css' import 'animate.css' -import '@/styles/notion.css' import '@/styles/globals.css' +import '@/styles/notion.css' +import 'rc-dropdown/assets/index.css' +import 'prismjs/themes/prism-okaidia.css' +import 'katex/dist/katex.min.css' import BLOG from 'blog.config' import dynamic from 'next/dynamic' import { GlobalContextProvider } from '@/lib/global' diff --git a/pages/article/[slug].js b/pages/article/[slug].js index 8356a5d0..622990a4 100644 --- a/pages/article/[slug].js +++ b/pages/article/[slug].js @@ -14,7 +14,6 @@ import Custom404 from '@/pages/404' import Link from 'next/link' import Image from 'next/image' -import 'prismjs/themes/prism-okaidia.css' import 'prismjs' import 'prismjs/components/prism-bash' import 'prismjs/components/prism-markup' @@ -30,6 +29,10 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faEye, faFolderOpen } from '@fortawesome/free-solid-svg-icons' import BlogAround from '@/components/BlogAround' +import '@/styles/notion.css' +import 'rc-dropdown/assets/index.css' +import 'prismjs/themes/prism-okaidia.css' + const mapPageUrl = id => { return 'https://www.notion.so/' + id.replace(/-/g, '') } @@ -152,7 +155,10 @@ const ArticleDetail = ({ post, blockMap, tags, prev, next, allPosts, categories } export async function getStaticPaths () { - const posts = await getAllPosts({ from: 'slug - paths', includePage: true }) + const posts = [] + // if (BLOG.isProd) { + // posts = await getAllPosts({ from: 'slug - paths', includePage: true }) + // } return { paths: posts.map(row => `${BLOG.path}/article/${row.slug}`), fallback: true