From 5f3d9bc3c29897f789a8d7941b7b0ff99aa1ca40 Mon Sep 17 00:00:00 2001 From: radishzzz Date: Sun, 16 Mar 2025 00:51:39 +0000 Subject: [PATCH] chore: unbind unocss shortcut --- src/components/MainHeader.astro | 4 ++-- src/components/PostList.astro | 4 ++-- src/components/Widgets/LanguageSwitcher.astro | 2 +- src/components/Widgets/ThemeToggle.astro | 2 +- src/content/about/about-ja.md | 2 +- src/content/about/about-zh-tw.md | 2 +- src/content/about/about-zh.md | 2 +- src/pages/[...posts_slug].astro | 7 ++++--- src/pages/[...tags_tag].astro | 2 +- src/styles/heti.css | 2 +- uno.config.ts | 5 ----- 11 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/components/MainHeader.astro b/src/components/MainHeader.astro index f512e42..6ce0d6b 100644 --- a/src/components/MainHeader.astro +++ b/src/components/MainHeader.astro @@ -19,7 +19,7 @@ const marginBottom = { ---
-

+

{headerSubtitle && ( -

+

{headerSubtitle}

)} diff --git a/src/components/PostList.astro b/src/components/PostList.astro index 9a7039b..862d0a6 100644 --- a/src/components/PostList.astro +++ b/src/components/PostList.astro @@ -46,7 +46,7 @@ function getPostPath(post: Post) { {/* mobile post time */}
@@ -58,7 +58,7 @@ function getPostPath(post: Post) { {/* desktop post time */}
diff --git a/src/components/Widgets/LanguageSwitcher.astro b/src/components/Widgets/LanguageSwitcher.astro index 0a897cf..805ddc1 100644 --- a/src/components/Widgets/LanguageSwitcher.astro +++ b/src/components/Widgets/LanguageSwitcher.astro @@ -22,7 +22,7 @@ const nextUrl = useSupportedLangs = {} // 填充映射 - posts.forEach((post) => { + posts.forEach((post: CollectionEntry<'posts'>) => { const slug = post.data.abbrlink || post.slug const lang = post.data.lang || defaultLocale @@ -55,7 +56,7 @@ export async function getStaticPaths() { const paths: PathItem[] = [] // 默认语言的文章页面 (没有语言前缀) - posts.forEach((post) => { + posts.forEach((post: CollectionEntry<'posts'>) => { if (import.meta.env.DEV || !post.data.draft) { const slug = post.data.abbrlink || post.slug const postLang = post.data.lang || defaultLocale @@ -77,7 +78,7 @@ export async function getStaticPaths() { // 更多语言的文章页面 (有语言前缀) allLocales.forEach((lang: string) => { if (lang !== defaultLocale) { - posts.forEach((post) => { + posts.forEach((post: CollectionEntry<'posts'>) => { if ((import.meta.env.DEV || !post.data.draft) && (post.data.lang === lang || post.data.lang === '')) { const slug = post.data.abbrlink || post.slug paths.push({ diff --git a/src/pages/[...tags_tag].astro b/src/pages/[...tags_tag].astro index eacd0ce..4f60bf0 100644 --- a/src/pages/[...tags_tag].astro +++ b/src/pages/[...tags_tag].astro @@ -68,7 +68,7 @@ function getTagUrl(tagName: string): string { href={getTagUrl(tagName)} class={`uno-tags-style ${ tag === tagName - ? 'uno-tag-active' + ? 'border-secondary/75 text-primary' : '' }`} > diff --git a/src/styles/heti.css b/src/styles/heti.css index 6a3ae33..5ef4787 100644 --- a/src/styles/heti.css +++ b/src/styles/heti.css @@ -24,7 +24,7 @@ margin-block-end:0 !important } .heti a { - --at-apply: 'uno-article-underline'; + --at-apply: 'underline mx-0.25em decoration-secondary/25 font-medium underline-0.075em underline-offset-0.2em hover:(c-primary decoration-secondary/75 transition)'; } .heti blockquote { margin-block-start:12px; diff --git a/uno.config.ts b/uno.config.ts index 10941e4..6d6ddd5 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -33,14 +33,9 @@ export default defineConfig({ }, }, shortcuts: { - 'uno-article-underline': 'underline mx-0.25em decoration-secondary/25 font-medium underline-0.075em underline-offset-0.2em hover:(c-primary decoration-secondary/75 transition)', 'uno-tags-style': 'inline-block whitespace-nowrap border border-secondary/25 rounded-full px-3.2 py-0.7 c-secondary transition-colors hover:(border-secondary/75 text-primary)', - 'uno-tag-active': 'border-secondary/75 text-primary', 'uno-decorative-line': 'h-0.25 w-10 bg-secondary opacity-25', - 'uno-mobile-time': 'mb-5.625 text-3.5 leading-6.875 font-time lg:(hidden)', - 'uno-desktop-time': 'mb-5.625 hidden text-3.65 leading-6.875 font-time lg:(ml-2.5 inline)', 'uno-tags-wrapper': 'mt-4.375 w-95% flex flex-wrap gap-3', - 'uno-button': 'aspect-square w-4 c-secondary active:scale-90 hover:c-primary', }, rules: [ ['scrollbar-hidden', {