File tree Expand file tree Collapse file tree 3 files changed +312
-386
lines changed
Expand file tree Collapse file tree 3 files changed +312
-386
lines changed Original file line number Diff line number Diff line change 1+ import { Jimp } from "jimp" ;
12const { createHash } = require ( 'crypto' )
23
3- var Jimp = require ( 'jimp' )
4-
54async function getOgImage ( { title, user, type } ) {
65 if ( process . env . NODE_ENV === 'development' ) {
76 return 'og image will be generated in production'
87 }
98
109 const hash = createHash ( 'md5' ) . update ( title ) . digest ( 'hex' )
1110
12- Jimp . read ( `public/images/og/templates/${ type } .png` , ( err , image ) => {
11+ Jimp . read ( `public/images/og/templates/${ type } .png` , ( err , image ) => {
1312 if ( err ) throw err
1413
1514 Promise . all ( [
Original file line number Diff line number Diff line change 1414 "dayjs" : " ^1.11.10" ,
1515 "fathom-client" : " ^3.6.0" ,
1616 "gray-matter" : " ^4.0.3" ,
17- "jimp" : " ^0.22.12 " ,
17+ "jimp" : " ^1.6.0 " ,
1818 "markdown-it" : " ^13.0.2" ,
1919 "next" : " ^14.2.10" ,
2020 "react" : " 18.2.0" ,
You can’t perform that action at this time.
0 commit comments