From 006bb82170915e25193e2a47c9f915dbf20ab8f4 Mon Sep 17 00:00:00 2001 From: Vixcity <2091283625@qq.com> Date: Wed, 1 Feb 2023 14:39:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20DIY=20=E5=BC=95=E5=85=A5?= =?UTF-8?q?=20CSS=20=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blog.config.js | 7 +++++-- pages/_document.js | 27 ++++++++++++++++++------- themes/hexo/LayoutSlug.js | 2 +- themes/hexo/components/BlogPostCard.js | 2 +- themes/hexo/components/Card.js | 2 +- themes/hexo/components/Footer.js | 2 +- themes/hexo/components/HeaderArticle.js | 4 ++-- themes/hexo/components/SideRight.js | 2 +- 8 files changed, 32 insertions(+), 16 deletions(-) diff --git a/blog.config.js b/blog.config.js index c0fcca5e..5f3270bf 100644 --- a/blog.config.js +++ b/blog.config.js @@ -71,16 +71,19 @@ const BLOG = { SAKURA: process.env.NEXT_PUBLIC_SAKURA || false, // 开关 // 漂浮线段特效 - NEST: process.env.NEXT_PUBLIC_NEST || false, // 开关 + NEST: process.env.NEXT_PUBLIC_NEST || true, // 开关 // 动态彩带特效 - FLUTTERINGRIBBON: process.env.NEXT_PUBLIC_FLUTTERINGRIBBON || false, // 开关 + FLUTTERINGRIBBON: process.env.NEXT_PUBLIC_FLUTTERINGRIBBON || true, // 开关 // 静态彩带特效 RIBBON: process.env.NEXT_PUBLIC_RIBBON || false, // 开关 // 星空雨特效 黑夜模式才会生效 STARRY_SKY: process.env.NEXT_PUBLIC_STARRY_SKY || false, // 开关 + // 样式代码 + CSS_LIST: [''], + // 悬浮挂件 WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || true, // 是否显示宠物挂件 WIDGET_PET_LINK: 'https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models diff --git a/pages/_document.js b/pages/_document.js index 4438697e..d963fc40 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -11,20 +11,33 @@ class MyDocument extends Document { render() { return ( - + - - + + + {console.log(this.renderCSS())} + {this.renderCSS()} - - -
- + +
+ ) } + + renderCSS() { + if (BLOG.CSS_LIST && BLOG.CSS_LIST.length > 0) { + return BLOG.CSS_LIST.map((item, index) => { + return ( + + ) + }) + } + } } export default MyDocument diff --git a/themes/hexo/LayoutSlug.js b/themes/hexo/LayoutSlug.js index 327497ac..7ee0c152 100644 --- a/themes/hexo/LayoutSlug.js +++ b/themes/hexo/LayoutSlug.js @@ -46,7 +46,7 @@ export const LayoutSlug = props => { showTag={false} floatSlot={floatSlot} > -
+
{lock && } {!lock &&
diff --git a/themes/hexo/components/BlogPostCard.js b/themes/hexo/components/BlogPostCard.js index df120154..dcbf6bbd 100644 --- a/themes/hexo/components/BlogPostCard.js +++ b/themes/hexo/components/BlogPostCard.js @@ -14,7 +14,7 @@ const BlogPostCard = ({ post, showSummary }) => { data-aos-easing="ease-in-out" data-aos-once="false" data-aos-anchor-placement="top-bottom" - className="w-full drop-shadow-md border dark:border-black rounded-xl bg-white dark:bg-hexo-black-gray duration-300"> + className="w-full drop-shadow-md border dark:border-black rounded-xl bg-white dark:bg-hexo-black-gray duration-300 coverArticle">
{ return
<>{headerSlot} -
+
{children}
diff --git a/themes/hexo/components/Footer.js b/themes/hexo/components/Footer.js index 3fc42d36..7cefa951 100644 --- a/themes/hexo/components/Footer.js +++ b/themes/hexo/components/Footer.js @@ -14,7 +14,7 @@ const Footer = ({ title }) => { return (
diff --git a/themes/hexo/components/HeaderArticle.js b/themes/hexo/components/HeaderArticle.js index fef4ec74..3256f5d0 100644 --- a/themes/hexo/components/HeaderArticle.js +++ b/themes/hexo/components/HeaderArticle.js @@ -19,7 +19,7 @@ export default function HeaderArticle({ post, siteInfo }) { return (
- ); + ) } diff --git a/themes/hexo/components/SideRight.js b/themes/hexo/components/SideRight.js index 8680f144..5e6da1ec 100644 --- a/themes/hexo/components/SideRight.js +++ b/themes/hexo/components/SideRight.js @@ -22,7 +22,7 @@ export default function SideRight(props) { } = props return ( -
+
{CONFIG_HEXO.WIDGET_ANALYTICS && }