Skip to content

Commit

Permalink
Don't compile Typst in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaschka committed Jun 5, 2024
1 parent 6ab286a commit 29bf264
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/typst-delegis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { compileTypst } from "./compile.ts";
export const typstDelegis = () => (site: Site) => {
site.preprocess([".typ"], async (filteredPages, allPages) => {
const urls: Record<string, Metadata> = {};
await Promise.allSettled(filteredPages.map(async (page) => {
for (const page of filteredPages) {
const metadata = await readMetadata(site.src(page.sourcePath));
urls[site.url(page.data.url)] = metadata;

Expand All @@ -30,11 +30,12 @@ export const typstDelegis = () => (site: Site) => {
site.dest(page.outputPath, ".."),
{ recursive: true },
);

await compileTypst(
site.src(page.sourcePath),
site.dest(page.outputPath.replace("index.html", "rendered.pdf")),
);
}));
}

allPages.map((page) => page.data = { ...page.data, vos: urls });
});
Expand Down

0 comments on commit 29bf264

Please sign in to comment.