chore: fix segment failed.

This commit is contained in:
Yufan Sheng 2024-06-18 20:29:53 +08:00
parent 28026bcc09
commit d70c4ae9eb
Signed by: syhily
GPG Key ID: 9D18A22A7DCD5A9B
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 { resolveSong, type MusicPlayerProps } from '@/components/player/resolver';
import 'aplayer/dist/APlayer.min.css';
interface Props extends MusicPlayerProps {} interface Props extends MusicPlayerProps {}

View File

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

View File

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