mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
fix: use Nunito font for OG image instead of missing Google Sans Code
This commit is contained in:
+4
-4
@@ -6,7 +6,7 @@ import { getFontPathByWeight } from "@/utils/getFontPathByWeight";
|
|||||||
import config from "@/config";
|
import config from "@/config";
|
||||||
|
|
||||||
export const GET: APIRoute = async context => {
|
export const GET: APIRoute = async context => {
|
||||||
const fonts = fontData["--font-google-sans-code"];
|
const fonts = fontData["--font-nunito"];
|
||||||
const regularFontPath = getFontPathByWeight(fonts, 400);
|
const regularFontPath = getFontPathByWeight(fonts, 400);
|
||||||
const boldFontPath = getFontPathByWeight(fonts, 700);
|
const boldFontPath = getFontPathByWeight(fonts, 700);
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export const GET: APIRoute = async context => {
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
fontFamily: "Google Sans Code",
|
fontFamily: "Nunito",
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
@@ -145,13 +145,13 @@ export const GET: APIRoute = async context => {
|
|||||||
embedFont: true,
|
embedFont: true,
|
||||||
fonts: [
|
fonts: [
|
||||||
{
|
{
|
||||||
name: "Google Sans Code",
|
name: "Nunito",
|
||||||
data: regularData,
|
data: regularData,
|
||||||
weight: 400,
|
weight: 400,
|
||||||
style: "normal",
|
style: "normal",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Google Sans Code",
|
name: "Nunito",
|
||||||
data: boldData,
|
data: boldData,
|
||||||
weight: 700,
|
weight: 700,
|
||||||
style: "normal",
|
style: "normal",
|
||||||
|
|||||||
Reference in New Issue
Block a user