File tree Expand file tree Collapse file tree 4 files changed +80
-11
lines changed
Expand file tree Collapse file tree 4 files changed +80
-11
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export default defineConfig({
5353 // }
5454 // }
5555 // },
56+ plugins : [ rawFonts ( [ '.ttf' ] ) ] ,
5657 optimizeDeps : {
5758 exclude : [ "@resvg/resvg-js" ] ,
5859 } ,
@@ -66,3 +67,18 @@ export default defineConfig({
6667 // So we're instructing Astro to put the static build output in a folder of that name.
6768 outDir : "./dist" ,
6869} ) ;
70+
71+ function rawFonts ( ext ) {
72+ return {
73+ name : 'vite-plugin-raw-fonts' ,
74+ transform ( _ , id ) {
75+ if ( ext . some ( e => id . endsWith ( e ) ) ) {
76+ const buffer = fs . readFileSync ( id ) ;
77+ return {
78+ code : `export default ${ JSON . stringify ( buffer ) } ` ,
79+ map : null
80+ } ;
81+ }
82+ }
83+ } ;
84+ }
Original file line number Diff line number Diff line change 11{
22 "name" : " emeraldjava.github.io" ,
3- "version" : " 2024.11.16 " ,
3+ "version" : " 2024.12.21 " ,
44 "scripts" : {
55 "dev" : " astro dev" ,
66 "start" : " astro dev" ,
1818 "@astrojs/rss" : " ^4.0.7" ,
1919 "@giscus/react" : " ^3.0.0" ,
2020 "@resvg/resvg-js" : " ^2.6.2" ,
21+ "@vercel/og" : " ^0.6.4" ,
2122 "astro" : " ^4.16.3" ,
2223 "fuse.js" : " ^7.0.0" ,
2324 "lodash.kebabcase" : " ^4.1.1" ,
Original file line number Diff line number Diff line change @@ -45,17 +45,23 @@ async function loadGoogleFonts(
4545> {
4646 const fontsConfig = [
4747 {
48- name : "IBM Plex Mono" ,
49- font : "IBM+Plex +Mono" ,
48+ name : "Space Mono" ,
49+ font : "Space +Mono" ,
5050 weight : 400 ,
5151 style : "normal" ,
5252 } ,
53- {
54- name : "IBM Plex Mono" ,
55- font : "IBM+Plex+Mono:wght@700" ,
56- weight : 700 ,
57- style : "bold" ,
58- } ,
53+ // {
54+ // name: "IBM Plex Mono",
55+ // font: "IBM+Plex+Mono",
56+ // weight: 400,
57+ // style: "normal",
58+ // },
59+ // {
60+ // name: "IBM Plex Mono",
61+ // font: "IBM+Plex+Mono:wght@700",
62+ // weight: 700,
63+ // style: "bold",
64+ // },
5965 ] ;
6066
6167 const fonts = await Promise . all (
You can’t perform that action at this time.
0 commit comments