mirror of
https://github.com/wavetermdev/docusaurus-og.git
synced 2026-08-05 13:46:35 -07:00
Use fsp
Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com>
This commit is contained in:
@@ -29,8 +29,9 @@ class ImageGenerator {
|
||||
const absolutePath = path_1.default.join(this.outDir, imageName);
|
||||
const relativePath = path_1.default.join('/', this.args.dir, absolutePath.slice(this.outDir.length));
|
||||
const svg = await this.satori(element, options);
|
||||
const pngBuffer = new resvg_js_1.Resvg(svg).render().asPng();
|
||||
fs.writeFileSync(absolutePath, pngBuffer);
|
||||
const resvg = new resvg_js_1.Resvg(svg);
|
||||
const pngOutput = resvg.render();
|
||||
await fsp.writeFile(absolutePath, pngOutput.asPng());
|
||||
const url = new URL(this.args.websiteUrl);
|
||||
url.pathname = relativePath;
|
||||
this.cache[hash] = {
|
||||
|
||||
@@ -54,8 +54,9 @@ export class ImageGenerator {
|
||||
)
|
||||
|
||||
const svg = await this.satori(element, options)
|
||||
const pngBuffer = new Resvg(svg).render().asPng();
|
||||
fs.writeFileSync(absolutePath, pngBuffer);
|
||||
const resvg = new Resvg(svg);
|
||||
const pngOutput = resvg.render();
|
||||
await fsp.writeFile(absolutePath, pngOutput.asPng());
|
||||
|
||||
const url = new URL(this.args.websiteUrl)
|
||||
url.pathname = relativePath
|
||||
|
||||
Reference in New Issue
Block a user