From 1f4b9a54f83c3314666f34204558dc00f54e8566 Mon Sep 17 00:00:00 2001 From: tangly Date: Fri, 21 Oct 2022 16:57:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E5=AD=97?= =?UTF-8?q?=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 17 +++++------------ pages/_document.js | 12 ++++++------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/blog.config.js b/blog.config.js index 6030b766..23d02168 100644 --- a/blog.config.js +++ b/blog.config.js @@ -5,7 +5,7 @@ const BLOG = { LINK: 'https://tangly1024.com', // 网站地址 KEYWORDS: 'Notion, 博客', // 网站关键词 英文逗号隔开 NOTION_PAGE_ID: - process.env.NOTION_PAGE_ID || '02ab3b8678004aa69e9e415905ef32a5', // Important page_id!!!Duplicate Template from https://www.notion.so/tanghh/02ab3b8678004aa69e9e415905ef32a5 + process.env.NOTION_PAGE_ID || '02ab3b8678004aa69e9e415905ef32a5', // Important page_id!!!Duplicate Template from https://www.notion.so/tanghh/02ab3b8678004aa69e9e415905ef32a5 NOTION_ACCESS_TOKEN: process.env.NOTION_ACCESS_TOKEN || '', // Useful if you prefer not to make your database public DEBUG: process.env.NEXT_PUBLIC_DEBUG || false, // 是否显示调试按钮 @@ -25,18 +25,11 @@ const BLOG = { BEI_AN: process.env.NEXT_PUBLIC_BEI_AN || '', // 备案号 闽ICP备XXXXXXX APPEARANCE: 'light', // ['light', 'dark', 'auto'], // light 日间模式 , dark夜间模式, auto根据时间和主题自动夜间模式 - // 字体配置 - CUSTOM_FONT: false, // 是否使用自定义字体 - CUSTOM_FONT_URL: [], // 自定义字体的CSS - CUSTOM_FONT_SANS: [], // 自定义无衬线字体 - CUSTOM_FONT_SERIF: [], // 自定义衬线字体 - // 自定义字体示例: 请先将 CUSTOM_FONT 改为 true, 并将 CUSTOM_FONT_URL 改为你的字体CSS地址,同时在 CUSTOM_FONT_SANS 与 CUSTOM_FONT_SERIF 中指定你的 fontfamily - // 以下是示例: - // CUSTOM_FONT: true, // 是否使用自定义字体 - // CUSTOM_FONT_URL: ['https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.6.0/lxgwwenkaiscreen.css'], // 自定义字体的CSS - // CUSTOM_FONT_SANS: ['LXGW WenKai Screen'], // 自定义无衬线字体 - // CUSTOM_FONT_SERIF: ['LXGW WenKai Screen'], // 自定义衬线字体 + CUSTOM_FONT: true, // 是否使用自定义字体 + CUSTOM_FONT_URL: ['https://cdn.jsdelivr.net/npm/lxgw-wenkai-screen-webfont@1.6.0/lxgwwenkaiscreen.css'], // 自定义字体的CSS + CUSTOM_FONT_SANS: ['LXGW WenKai Screen'], // 自定义无衬线字体 + CUSTOM_FONT_SERIF: ['LXGW WenKai Screen'], // 自定义衬线字体 // 图标字体 FONT_AWESOME_PATH: 'https://cdn.bootcdn.net/ajax/libs/font-awesome/5.15.4/css/all.min.css', // 图标库CDN ,国内推荐BootCDN,国外推荐 CloudFlare https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css diff --git a/pages/_document.js b/pages/_document.js index ff10b054..aa0d0e02 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -15,15 +15,15 @@ class MyDocument extends Document { - {/* 谷歌字体镜像 */} - {BLOG.CUSTOM_FONT - ? - : BLOG.CUSTOM_FONT_URL?.map(fontUrl => - )} + { BLOG.CUSTOM_FONT + ? BLOG.CUSTOM_FONT_URL?.map(fontUrl => + ) + : } - + + 字体
{JSON.parse(BLOG.CUSTOM_FONT)}
{BLOG.CUSTOM_FONT_URL}