[fix] migrate localfont to hosted font

This commit is contained in:
PrinOrange
2024-08-12 13:39:19 +08:00
parent e711954b3d
commit c50dffcc6d
19 changed files with 58 additions and 37 deletions

View File

@@ -3741,6 +3741,6 @@
U+8061, U+806f-8070, U+8072-8073, U+8075-8077, U+807d-807e; 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"; font-family: "fang-zheng-xiao-biao-song", "Noto Serif KR Black";
} }

View File

@@ -4197,6 +4197,6 @@
U+93cb-93cc, U+93d1; U+93cb-93cc, U+93d1;
} }
.font-source-serif-screen { .content-font {
font-family: "source-serif-screen", "source-serif-screen-kr"; font-family: "source-serif-screen", "source-serif-screen-kr";
} }

View File

@@ -20,10 +20,10 @@ export const HomeCover = () => {
/> />
</div> </div>
</div> </div>
<div className={`font-fang-zheng-xiao-biao-song my-8 text-center text-4xl font-bold`}>{Config.Nickname}</div> <div className={`caption-font my-8 text-center text-4xl font-bold`}>{Config.Nickname}</div>
{Config.Sentence && ( {Config.Sentence && (
<div className="my-5 flex justify-center"> <div className="my-5 flex justify-center">
<p className={`font-source-serif-screen text-lg`}>{Config.Sentence}</p> <p className={`content-font text-lg`}>{Config.Sentence}</p>
</div> </div>
)} )}
<div className="my-8"> <div className="my-8">

View File

@@ -1,6 +1,6 @@
const H2 = (props: JSX.IntrinsicElements["h2"]) => { const H2 = (props: JSX.IntrinsicElements["h2"]) => {
return ( return (
<h2 className={`font-fang-zheng-xiao-biao-song scroll-mt-20`} id={props.id}> <h2 className={`caption-font scroll-mt-20`} id={props.id}>
{props.children} {props.children}
</h2> </h2>
); );

View File

@@ -4,7 +4,7 @@ export const BottomCard = () => {
return ( return (
<div className="p-8 w-full flex flex-col justify-center"> <div className="p-8 w-full flex flex-col justify-center">
<img alt={Config.AuthorName} className="h-24 w-24 rounded-full mx-auto" src={Config.AvatarURL} /> <img alt={Config.AuthorName} className="h-24 w-24 rounded-full mx-auto" src={Config.AvatarURL} />
<p className="mx-auto mt-5 font-source-serif-screen">{Config.Sentence}</p> <p className="mx-auto mt-5 content-font">{Config.Sentence}</p>
</div> </div>
); );
}; };

View File

@@ -4,11 +4,11 @@ export const SponsorDescription = () => {
return ( return (
<div className="h-full"> <div className="h-full">
{!Config.Sponsor ? ( {!Config.Sponsor ? (
<p className={`font-source-serif-screen break-words text-lg`}> <p className={`content-font break-words text-lg`}>
{"Thank you, for data and personal private security, every sponsor method was paused."} {"Thank you, for data and personal private security, every sponsor method was paused."}
</p> </p>
) : ( ) : (
<p className={`font-source-serif-screen break-words text-lg`}> <p className={`content-font break-words text-lg`}>
{ {
"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." "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."
} }

View File

@@ -34,7 +34,7 @@ export const NavBar = () => {
<Sheet onOpenChange={(open) => setIsSideNavOpen(open)} open={isSideNavOpen}> <Sheet onOpenChange={(open) => setIsSideNavOpen(open)} open={isSideNavOpen}>
<div className="sticky top-0 z-50 border-black-200 dark:border-gray-700 border-b bg-white dark:bg-gray-950 flex flex-wrap justify-between py-3 px-5 md:px-10 lg:px-20 xl:px-32 2xl:px-52"> <div className="sticky top-0 z-50 border-black-200 dark:border-gray-700 border-b bg-white dark:bg-gray-950 flex flex-wrap justify-between py-3 px-5 md:px-10 lg:px-20 xl:px-32 2xl:px-52">
<Link className="cursor-pointer my-auto text-2xl font-bold" href="/"> <Link className="cursor-pointer my-auto text-2xl font-bold" href="/">
<h1 className={`font-fang-zheng-xiao-biao-song my-auto`} title="Click to jump to home page."> <h1 className={`website-title-font my-auto`} title="Click to jump to home page.">
{Config.SiteTitle} {Config.SiteTitle}
</h1> </h1>
</Link> </Link>

View File

@@ -14,7 +14,7 @@ export const PostList = (props: { data: TPostListItem[] }) => {
index !== props.data.length - 1 && "border-b" 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`} } border-gray-200 hover:bg-gray-50 dark:hover:bg-gray-900 dark:border-gray-800 px-3 py-1`}
> >
<div className={"font-source-serif-screen flex-col py-3"}> <div className={"post-list-caption-font flex-col py-3"}>
<div className="flex justify-center"> <div className="flex justify-center">
<h3 className="mx-auto text-lg font-extrabold capitalize">{postItem.frontMatter.title}</h3> <h3 className="mx-auto text-lg font-extrabold capitalize">{postItem.frontMatter.title}</h3>
</div> </div>
@@ -27,7 +27,7 @@ export const PostList = (props: { data: TPostListItem[] }) => {
</div> </div>
</div> </div>
{postItem.frontMatter.summary && ( {postItem.frontMatter.summary && (
<div className={"font-source-serif-screen flex justify-center"}> <div className={"content-font flex justify-center"}>
<p>{postItem.frontMatter.summary}</p> <p>{postItem.frontMatter.summary}</p>
</div> </div>
)} )}

View File

@@ -14,13 +14,11 @@ export default function NotFoundPage() {
<Page> <Page>
<NavBar /> <NavBar />
<ContentContainer> <ContentContainer>
<h2 className={`my-5 flex justify-center text-2xl font-bold font-fang-zheng-xiao-biao-song`}> <h2 className={`my-5 flex justify-center text-2xl font-bold caption-font`}>{"404 NOT FOUND"}</h2>
{"404 NOT FOUND"}
</h2>
<Separator /> <Separator />
<div className="my-5 flex flex-col justify-center"> <div className="my-5 flex flex-col justify-center">
<TfiFaceSad className="mx-auto my-4" size={"6em"} /> <TfiFaceSad className="mx-auto my-4" size={"6em"} />
<p className={`font-source-serif-screen mx-auto my-3 text-center text-xl`}> <p className={`content-font mx-auto my-3 text-center text-xl`}>
{"This page does not exist for it might be removed or closed."} {"This page does not exist for it might be removed or closed."}
</p> </p>
<div className="my-5 flex justify-center"> <div className="my-5 flex justify-center">

View File

@@ -14,13 +14,11 @@ export default function ServerErrorPage() {
<Page> <Page>
<NavBar /> <NavBar />
<ContentContainer> <ContentContainer>
<h2 className={`my-5 flex justify-center text-2xl font-bold font-fang-zheng-xiao-biao-song`}> <h2 className={`my-5 flex justify-center text-2xl font-bold caption-font`}>{"INVALID OPERATION"}</h2>
{"INVALID OPERATION"}
</h2>
<Separator /> <Separator />
<div className="my-5 flex flex-col justify-center"> <div className="my-5 flex flex-col justify-center">
<MdOutlineDangerous className="mx-auto my-4" size={"6em"} /> <MdOutlineDangerous className="mx-auto my-4" size={"6em"} />
<p className={`font-source-serif-screen mx-auto my-3 text-center text-xl`}> <p className={`content-font mx-auto my-3 text-center text-xl`}>
{"Something went wrong. Please try again later."} {"Something went wrong. Please try again later."}
</p> </p>
<div className="my-5 flex justify-center"> <div className="my-5 flex justify-center">

View File

@@ -18,9 +18,9 @@ export default function AboutPage() {
/> />
<NavBar /> <NavBar />
<ContentContainer> <ContentContainer>
<h2 className={`my-5 flex justify-around text-2xl font-bold font-fang-zheng-xiao-biao-song`}>{"ABOUT ME"}</h2> <h2 className={`my-5 flex justify-around text-2xl font-bold caption-font`}>{"ABOUT ME"}</h2>
<Separator /> <Separator />
<div className={`font-source-serif-screen my-5 justify-center md:flex md:space-x-10`}> <div className={`content-font my-5 justify-center md:flex md:space-x-10`}>
<div className="my-auto flex md:w-1/3"> <div className="my-auto flex md:w-1/3">
<img alt="my-profile" className="mx-auto my-auto max-h-[23rem] rounded-lg" src="/images/profile.webp" /> <img alt="my-profile" className="mx-auto my-auto max-h-[23rem] rounded-lg" src="/images/profile.webp" />
</div> </div>

View File

@@ -78,20 +78,18 @@ const ReaderPage = (props: ReaderPageProps) => {
{props.frontMatter.coverURL && <PostCover coverURL={props.frontMatter.coverURL} />} {props.frontMatter.coverURL && <PostCover coverURL={props.frontMatter.coverURL} />}
<div className="pb-1 border-b-2 border-black dark:border-gray-300"> <div className="pb-1 border-b-2 border-black dark:border-gray-300">
<div <div
className={`font-fang-zheng-xiao-biao-song my-2 text-black dark:text-white flex justify-center whitespace-normal break-words text-3xl font-bold capitalize`} className={`caption-font my-2 text-black dark:text-white flex justify-center whitespace-normal break-words text-3xl font-bold capitalize`}
> >
{props.frontMatter?.title} {props.frontMatter?.title}
</div> </div>
{props.frontMatter?.subtitle && ( {props.frontMatter?.subtitle && (
<div <div className={`caption-font my-1 flex justify-center text-xl font-bold capitalize`}>
className={`font-fang-zheng-xiao-biao-song my-1 flex justify-center text-xl font-bold capitalize`}
>
{props.frontMatter.subtitle} {props.frontMatter.subtitle}
</div> </div>
)} )}
<div className="my-1 flex justify-center text-sm italic">{normalizeDate(props.frontMatter?.time)}</div> <div className="my-1 flex justify-center text-sm italic">{normalizeDate(props.frontMatter?.time)}</div>
{props.frontMatter?.summary && ( {props.frontMatter?.summary && (
<p className={"font-source-serif-screen my-4 indent-8 text-gray-800 dark:text-gray-300"}> <p className={"content-font my-4 indent-8 text-gray-800 dark:text-gray-300"}>
{props.frontMatter?.summary} {props.frontMatter?.summary}
</p> </p>
)} )}
@@ -110,7 +108,7 @@ const ReaderPage = (props: ReaderPageProps) => {
)} )}
</div> </div>
<div <div
className={`text-wrap border-gray-500 font-source-serif-screen ${ className={`text-wrap border-gray-500 content-font ${
!props.frontMatter.allowShare ? "select-none" : "" !props.frontMatter.allowShare ? "select-none" : ""
}`} }`}
{...handleRightSwipe} {...handleRightSwipe}

View File

@@ -14,9 +14,9 @@ export default function FriendsPage() {
<SEO description={"My Friend Links"} title={`${Config.SiteTitle} - Friends`} /> <SEO description={"My Friend Links"} title={`${Config.SiteTitle} - Friends`} />
<NavBar /> <NavBar />
<ContentContainer> <ContentContainer>
<h2 className={`my-5 flex justify-center text-2xl font-bold font-fang-zheng-xiao-biao-song`}>{"FRIENDS"}</h2> <h2 className={`my-5 flex justify-center text-2xl font-bold caption-font`}>{"FRIENDS"}</h2>
<Separator /> <Separator />
<div className={`my-5 flex flex-wrap justify-center text-2xl font-source-serif-screen`}> <div className={`my-5 flex flex-wrap justify-center text-2xl content-font`}>
{FriendsList.map((item) => ( {FriendsList.map((item) => (
<Link className="mx-2 p-2 underline" href={item.url} key={nanoid()}> <Link className="mx-2 p-2 underline" href={item.url} key={nanoid()}>
{item.title} {item.title}

View File

@@ -35,7 +35,7 @@ export default function Home(props: HomePageProps) {
{props.pinnedPostList.length !== 0 && ( {props.pinnedPostList.length !== 0 && (
<div> <div>
<Separator /> <Separator />
<h2 className={`my-5 flex justify-center text-2xl font-bold font-fang-zheng-xiao-biao-song`}> <h2 className={`my-5 flex justify-center text-2xl font-bold caption-font`}>
<RiStarFill className="mx-2 my-auto" /> <RiStarFill className="mx-2 my-auto" />
{"PINNED POSTS"} {"PINNED POSTS"}
</h2> </h2>
@@ -46,7 +46,7 @@ export default function Home(props: HomePageProps) {
{props.latestPostList.length !== 0 && ( {props.latestPostList.length !== 0 && (
<div> <div>
<Separator /> <Separator />
<h2 className={`my-5 flex justify-center text-2xl font-bold font-fang-zheng-xiao-biao-song`}> <h2 className={`my-5 flex justify-center text-2xl font-bold caption-font`}>
<LuPenTool className="mx-2 my-auto" /> <LuPenTool className="mx-2 my-auto" />
{"LATEST POSTS"} {"LATEST POSTS"}
</h2> </h2>

View File

@@ -55,7 +55,7 @@ export default function PostsPage(props: PostsPageProps) {
/> />
<NavBar /> <NavBar />
<ContentContainer> <ContentContainer>
<h2 className={`my-5 flex justify-center text-2xl font-fang-zheng-xiao-biao-song font-bold`}> <h2 className={`my-5 flex justify-center text-2xl caption-font font-bold`}>
<LuPenTool className="mx-2 my-auto" /> <LuPenTool className="mx-2 my-auto" />
{"ALL POSTS"} {"ALL POSTS"}
</h2> </h2>

View File

@@ -22,7 +22,7 @@ export default function SponsorPage() {
<ContentContainer> <ContentContainer>
<div className="md:flex mt-10"> <div className="md:flex mt-10">
<div className="flex flex-col justify-center md:w-1/2"> <div className="flex flex-col justify-center md:w-1/2">
<h2 className={`my-5 flex justify-center text-2xl font-bold text-red-500 font-fang-zheng-xiao-biao-song`}> <h2 className={`my-5 flex justify-center text-2xl font-bold text-red-500 caption-font`}>
<GoHeartFill className="mx-2 my-auto" /> <GoHeartFill className="mx-2 my-auto" />
{"SPONSOR"} {"SPONSOR"}
</h2> </h2>

View File

@@ -52,7 +52,7 @@ export default function TagsContentPage(props: TagsContentPageProps) {
/> />
<NavBar /> <NavBar />
<ContentContainer> <ContentContainer>
<h2 className={"my-5 flex flex-col justify-center text-center font-bold font-fang-zheng-xiao-biao-song"}> <h2 className={"my-5 flex flex-col justify-center text-center font-bold caption-font"}>
<div className="mx-auto text-2xl">{`Posts of ${props.tagName}`}</div> <div className="mx-auto text-2xl">{`Posts of ${props.tagName}`}</div>
</h2> </h2>
<Separator /> <Separator />

View File

@@ -1,2 +1,29 @@
@import "../assets/font-css/fang-zheng-xiao-biao-song/index.css"; @import url("https://font-host.dreams.plus/fonts/fang-zheng-xiao-biao-song/index.css");
@import "../assets/font-css/source-serif-screen/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";
}

View File

@@ -35,7 +35,7 @@ module.exports = {
}, },
fontFamily: { fontFamily: {
fangzhengxiaobiaosong: "--font-fangzhengxiaobiaosong", fangzhengxiaobiaosong: "--font-fangzhengxiaobiaosong",
sourceSerifScreenCN: "--font-source-serif-screen-cn", sourceSerifScreenCN: "--content-font-cn",
}, },
colors: { colors: {
border: "hsl(var(--border))", border: "hsl(var(--border))",