Add support for fonts

This commit is contained in:
lowlighter
2020-10-25 00:19:57 +02:00
parent cdbb0e5b87
commit a4e15807ad
11 changed files with 116 additions and 48 deletions

View File

@@ -28,9 +28,10 @@
`${templates}/${name}/query.graphql`,
`${templates}/${name}/image.svg`,
`${templates}/${name}/style.css`,
`${templates}/${name}/fonts.css`,
]
const [query, image, style] = await Promise.all(files.map(async file => `${await fs.promises.readFile(path.resolve(file))}`))
assets[name] = {query, image, style}
const [query, image, style, fonts] = await Promise.all(files.map(async file => `${await fs.promises.readFile(path.resolve(file))}`))
assets[name] = {query, image, style, fonts}
}
code = code.replace(/<#assets>/g, Buffer.from(JSON.stringify(assets)).toString("base64"))