Skip to content

Commit

Permalink
import font as url
Browse files Browse the repository at this point in the history
  • Loading branch information
ibastawisi committed Oct 22, 2024
1 parent 7a1068a commit 6ebaba8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const config = {
config.module.rules.push({
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: "asset/resource",
resourceQuery: /url/,
});
return config
},
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/og/route.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* eslint-disable @next/next/no-img-element */
import { ImageResponse } from 'next/og';

export const runtime = 'edge';

export interface OgMetadata {
id: string;
title?: string;
Expand Down
6 changes: 3 additions & 3 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Metadata, Viewport } from 'next';
import { AppRouterCacheProvider } from '@mui/material-nextjs/v13-appRouter';
import ThemeProvider from '@/components/Layout/ThemeProvider';
import RobotoLatin400 from '@fontsource/roboto/files/roboto-latin-400-normal.woff2';
import RobotoLatin500 from '@fontsource/roboto/files/roboto-latin-500-normal.woff2';
import RobotoLatin700 from '@fontsource/roboto/files/roboto-latin-700-normal.woff2';
import RobotoLatin400 from '@fontsource/roboto/files/roboto-latin-400-normal.woff2?url';
import RobotoLatin500 from '@fontsource/roboto/files/roboto-latin-500-normal.woff2?url';
import RobotoLatin700 from '@fontsource/roboto/files/roboto-latin-700-normal.woff2?url';
import 'mathlive/static.css';
import '@/editor/theme.css';
import './globals.css';
Expand Down
7 changes: 5 additions & 2 deletions src/fonts.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
declare module '*.woff';
declare module '*.woff2';
declare module '*.woff2?url' {
const value: string;

export default value;
}

0 comments on commit 6ebaba8

Please sign in to comment.