From c50dffcc6d73ed34b2ebfba548f483523963d293 Mon Sep 17 00:00:00 2001 From: PrinOrange Date: Mon, 12 Aug 2024 13:39:19 +0800 Subject: [PATCH] [fix] migrate localfont to hosted font --- .../fang-zheng-xiao-biao-song/index.css | 2 +- assets/font-css/source-serif-screen/index.css | 2 +- components/homepage/HomeCover.tsx | 4 +-- components/mdx/H2.tsx | 2 +- components/readerpage/BottomCard.tsx | 2 +- .../sponsor-page/SponsorDescription.tsx | 4 +-- components/utils/NavBar.tsx | 2 +- components/utils/PostList.tsx | 4 +-- pages/404.tsx | 6 ++-- pages/500.tsx | 6 ++-- pages/about.tsx | 4 +-- pages/blog/[id].tsx | 10 +++--- pages/friends.tsx | 4 +-- pages/index.tsx | 4 +-- pages/posts/[[...slug]].tsx | 2 +- pages/sponsor.tsx | 2 +- pages/tags/[...slug].tsx | 2 +- styles/font.css | 31 +++++++++++++++++-- tailwind.config.js | 2 +- 19 files changed, 58 insertions(+), 37 deletions(-) diff --git a/assets/font-css/fang-zheng-xiao-biao-song/index.css b/assets/font-css/fang-zheng-xiao-biao-song/index.css index 3db9e06..4557598 100644 --- a/assets/font-css/fang-zheng-xiao-biao-song/index.css +++ b/assets/font-css/fang-zheng-xiao-biao-song/index.css @@ -3741,6 +3741,6 @@ U+8061, U+806f-8070, U+8072-8073, U+8075-8077, U+807d-807e; } -.font-fang-zheng-xiao-biao-song { +.caption-font { font-family: "fang-zheng-xiao-biao-song", "Noto Serif KR Black"; } diff --git a/assets/font-css/source-serif-screen/index.css b/assets/font-css/source-serif-screen/index.css index 6684d63..cb29461 100644 --- a/assets/font-css/source-serif-screen/index.css +++ b/assets/font-css/source-serif-screen/index.css @@ -4197,6 +4197,6 @@ U+93cb-93cc, U+93d1; } -.font-source-serif-screen { +.content-font { font-family: "source-serif-screen", "source-serif-screen-kr"; } diff --git a/components/homepage/HomeCover.tsx b/components/homepage/HomeCover.tsx index af48ecb..984dbf4 100644 --- a/components/homepage/HomeCover.tsx +++ b/components/homepage/HomeCover.tsx @@ -20,10 +20,10 @@ export const HomeCover = () => { /> -
{Config.Nickname}
+
{Config.Nickname}
{Config.Sentence && (
-

{Config.Sentence}

+

{Config.Sentence}

)}
diff --git a/components/mdx/H2.tsx b/components/mdx/H2.tsx index a9c72ce..cb1ecb4 100644 --- a/components/mdx/H2.tsx +++ b/components/mdx/H2.tsx @@ -1,6 +1,6 @@ const H2 = (props: JSX.IntrinsicElements["h2"]) => { return ( -

+

{props.children}

); diff --git a/components/readerpage/BottomCard.tsx b/components/readerpage/BottomCard.tsx index 51452a2..370dccc 100644 --- a/components/readerpage/BottomCard.tsx +++ b/components/readerpage/BottomCard.tsx @@ -4,7 +4,7 @@ export const BottomCard = () => { return (
{Config.AuthorName} -

{Config.Sentence}

+

{Config.Sentence}

); }; diff --git a/components/sponsor-page/SponsorDescription.tsx b/components/sponsor-page/SponsorDescription.tsx index fa96986..62091c1 100644 --- a/components/sponsor-page/SponsorDescription.tsx +++ b/components/sponsor-page/SponsorDescription.tsx @@ -4,11 +4,11 @@ export const SponsorDescription = () => { return (
{!Config.Sponsor ? ( -

+

{"Thank you, for data and personal private security, every sponsor method was paused."}

) : ( -

+

{ "If you like my works, I would deeply appreciate your support as a patron. Your contribution not only fuels my creative journey but also allows me to delve deeper into my passion. Your support plays a vital role in making this vision a reality. Thank you for considering becoming a patron and being an integral part of this work endeavor." } diff --git a/components/utils/NavBar.tsx b/components/utils/NavBar.tsx index e22333d..071f63e 100644 --- a/components/utils/NavBar.tsx +++ b/components/utils/NavBar.tsx @@ -34,7 +34,7 @@ export const NavBar = () => { setIsSideNavOpen(open)} open={isSideNavOpen}>

-

+

{Config.SiteTitle}

diff --git a/components/utils/PostList.tsx b/components/utils/PostList.tsx index c5a7823..f16c32c 100644 --- a/components/utils/PostList.tsx +++ b/components/utils/PostList.tsx @@ -14,7 +14,7 @@ export const PostList = (props: { data: TPostListItem[] }) => { index !== props.data.length - 1 && "border-b" } border-gray-200 hover:bg-gray-50 dark:hover:bg-gray-900 dark:border-gray-800 px-3 py-1`} > -
+

{postItem.frontMatter.title}

@@ -27,7 +27,7 @@ export const PostList = (props: { data: TPostListItem[] }) => {
{postItem.frontMatter.summary && ( -
+

{postItem.frontMatter.summary}

)} diff --git a/pages/404.tsx b/pages/404.tsx index 66c8789..ff91950 100644 --- a/pages/404.tsx +++ b/pages/404.tsx @@ -14,13 +14,11 @@ export default function NotFoundPage() { -

- {"404 NOT FOUND"} -

+

{"404 NOT FOUND"}

-

+

{"This page does not exist for it might be removed or closed."}

diff --git a/pages/500.tsx b/pages/500.tsx index a3dbbe6..0e30cdc 100644 --- a/pages/500.tsx +++ b/pages/500.tsx @@ -14,13 +14,11 @@ export default function ServerErrorPage() { -

- {"INVALID OPERATION"} -

+

{"INVALID OPERATION"}

-

+

{"Something went wrong. Please try again later."}

diff --git a/pages/about.tsx b/pages/about.tsx index f9de381..a79604b 100644 --- a/pages/about.tsx +++ b/pages/about.tsx @@ -18,9 +18,9 @@ export default function AboutPage() { /> -

{"ABOUT ME"}

+

{"ABOUT ME"}

-
+
my-profile
diff --git a/pages/blog/[id].tsx b/pages/blog/[id].tsx index a9c3ce8..0ac2692 100644 --- a/pages/blog/[id].tsx +++ b/pages/blog/[id].tsx @@ -78,20 +78,18 @@ const ReaderPage = (props: ReaderPageProps) => { {props.frontMatter.coverURL && }
{props.frontMatter?.title}
{props.frontMatter?.subtitle && ( -
+
{props.frontMatter.subtitle}
)}
{normalizeDate(props.frontMatter?.time)}
{props.frontMatter?.summary && ( -

+

{props.frontMatter?.summary}

)} @@ -110,7 +108,7 @@ const ReaderPage = (props: ReaderPageProps) => { )}
-

{"FRIENDS"}

+

{"FRIENDS"}

-
+
{FriendsList.map((item) => ( {item.title} diff --git a/pages/index.tsx b/pages/index.tsx index 749952e..6d243f7 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -35,7 +35,7 @@ export default function Home(props: HomePageProps) { {props.pinnedPostList.length !== 0 && (
-

+

{"PINNED POSTS"}

@@ -46,7 +46,7 @@ export default function Home(props: HomePageProps) { {props.latestPostList.length !== 0 && (
-

+

{"LATEST POSTS"}

diff --git a/pages/posts/[[...slug]].tsx b/pages/posts/[[...slug]].tsx index b45f4e2..b37f064 100644 --- a/pages/posts/[[...slug]].tsx +++ b/pages/posts/[[...slug]].tsx @@ -55,7 +55,7 @@ export default function PostsPage(props: PostsPageProps) { /> -

+

{"ALL POSTS"}

diff --git a/pages/sponsor.tsx b/pages/sponsor.tsx index 3c7bf96..6895623 100644 --- a/pages/sponsor.tsx +++ b/pages/sponsor.tsx @@ -22,7 +22,7 @@ export default function SponsorPage() {
-

+

{"SPONSOR"}

diff --git a/pages/tags/[...slug].tsx b/pages/tags/[...slug].tsx index 8e6cfb6..82a3e2f 100644 --- a/pages/tags/[...slug].tsx +++ b/pages/tags/[...slug].tsx @@ -52,7 +52,7 @@ export default function TagsContentPage(props: TagsContentPageProps) { /> -

+

{`Posts of ${props.tagName}`}

diff --git a/styles/font.css b/styles/font.css index 12c54eb..bbb33c6 100644 --- a/styles/font.css +++ b/styles/font.css @@ -1,2 +1,29 @@ -@import "../assets/font-css/fang-zheng-xiao-biao-song/index.css"; -@import "../assets/font-css/source-serif-screen/index.css"; +@import url("https://font-host.dreams.plus/fonts/fang-zheng-xiao-biao-song/index.css"); +@import url("https://font-host.dreams.plus/fonts/source-serif-4/index.css"); +@import url("https://font-host.dreams.plus/fonts/noto-serif-kr/index.css"); +@import url("https://font-host.dreams.plus/fonts/fang-zheng-serif-screen/index.css"); +@import url("https://font-host.dreams.plus/fonts/source-serif-screen/index.css"); + +.prose b { + font-weight: 600; +} + +.prose strong { + font-weight: 600; +} + +.caption-font { + font-family: "Source Serif 4", "FZXiaoBiaoSong-B05", "Noto Serif KR"; +} + +.content-font { + font-family: "Source Serif 4", "FZPingXianYaSong-R-GBK", "Noto Serif KR"; +} + +.website-title-font { + font-family: "FZXiaoBiaoSong-B05"; +} + +.post-list-caption-font { + font-family: "Clear Han Serif", "Noto Serif KR"; +} diff --git a/tailwind.config.js b/tailwind.config.js index a7d8f33..d82de32 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -35,7 +35,7 @@ module.exports = { }, fontFamily: { fangzhengxiaobiaosong: "--font-fangzhengxiaobiaosong", - sourceSerifScreenCN: "--font-source-serif-screen-cn", + sourceSerifScreenCN: "--content-font-cn", }, colors: { border: "hsl(var(--border))",