From eb38ca1edc1212e213c3c7363b8a3ffd73b971af Mon Sep 17 00:00:00 2001 From: Rhen Cloud Date: Fri, 2 Jan 2026 20:36:49 +0800 Subject: [PATCH] update --- app/app.vue | 19 + app/components/blog/Header.vue | 4 +- app/components/main/SocialLinks.vue | 44 +- app/components/main/header.vue | 50 +- app/components/main/hero.vue | 33 +- app/components/main/recent.vue | 2 +- app/config/index.ts | 9 +- app/layouts/default.vue | 2 +- app/pages/posts/index.vue | 121 - bun.lock | 3199 ++++---- bunfig.toml | 4 +- package.json | 1 + yarn.lock | 11318 -------------------------- 13 files changed, 1646 insertions(+), 13160 deletions(-) delete mode 100644 app/pages/posts/index.vue delete mode 100644 yarn.lock diff --git a/app/app.vue b/app/app.vue index 079d0ad..4e70374 100644 --- a/app/app.vue +++ b/app/app.vue @@ -11,6 +11,25 @@ useHead({ const desktopBg = siteConfig.theme.background || ""; const mobileBg = siteConfig.theme.backgroundMobile || ""; + +// 将 siteConfig.theme.color 转换为 CSS 变量 +const hexToRgb = (hex: string) => { + const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result + ? `${parseInt(result[1]!, 16)}, ${parseInt(result[2]!, 16)}, ${parseInt(result[3]!, 16)}` + : "189, 131, 243"; +}; + +const primaryColor = siteConfig.theme.color || "#bd83f3"; +const primaryRgb = hexToRgb(primaryColor); + +useHead({ + style: [ + { + innerHTML: `:root { --site-primary: ${primaryColor}; --site-primary-rgb: ${primaryRgb}; }`, + }, + ], +});