chore: fix segment failed.

This commit is contained in:
Yufan Sheng 2024-06-18 20:29:53 +08:00
parent bafd27150e
commit e0446c2669
Signed by: syhily
GPG Key ID: DEB186763C308C31
10 changed files with 7 additions and 35 deletions

View File

@ -1,27 +0,0 @@
/**
* OPPO Sans Fonts
*/
@font-face {
font-family: 'OPPOSans';
src:
url(OPPOSans-Regular.woff2) format('woff2'),
url(OPPOSans-Regular.ttf) format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'OPPOSans';
src:
url(OPPOSans-Medium.woff2) format('woff2'),
url(OPPOSans-Medium.ttf) format('truetype');
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'OPPOSans';
src:
url(OPPOSans-Bold.woff2) format('woff2'),
url(OPPOSans-Bold.ttf) format('truetype');
font-weight: 800;
font-style: normal;
}

View File

@ -1,6 +1,5 @@
---
import { resolveSong, type MusicPlayerProps } from '@/components/player/resolver';
import 'aplayer/dist/APlayer.min.css';
interface Props extends MusicPlayerProps {}

View File

@ -135,13 +135,13 @@ export const defaultOpenGraph = async (): Promise<Buffer> => {
return await fetchCover('/images/default-cover.jpg');
};
export const drawOpenGraph = async ({ title, summary, cover }: OpenGraphProps): Promise<Buffer> => {
// Register the font if it doesn't exist
if (!GlobalFonts.has('NotoSansSC-Bold')) {
const fontBuffer = await readFile(join(process.cwd(), 'src/assets/og/NotoSansSC-Bold.ttf'));
const fontBuffer = await readFile(join(process.cwd(), '/src/assets/og/NotoSansSC-Bold.ttf'));
GlobalFonts.register(fontBuffer, 'NotoSansSC-Bold');
}
export const drawOpenGraph = async ({ title, summary, cover }: OpenGraphProps): Promise<Buffer> => {
// Fetch the cover image as the background
const coverImage = new Image();
coverImage.src = await fetchCover(cover);

View File

@ -1,8 +1,8 @@
---
// tslint:disable:ordered-imports
import 'bootstrap/dist/css/bootstrap.min.css';
import '@/assets/styles/opposans/opposans.css';
import '@/assets/styles/iconfont/iconfont.css';
import 'aplayer/dist/APlayer.min.css';
import '@/assets/styles/reset.css';
import '@/assets/styles/globals.css';