-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): Separate markdown and html handling into stages
First run all markdown transformers on all files, and then run all html transformers on all files. This allows us to augment `allSlugs` from a markdown processor, so that we can add alias slugs from frontmatter, to be later used in the linker html processor when transforming links. For this to work with workers I had to write a very cringe hack. To be able to build the allSlugs list correctly not only from filenames, but also from frontmatter without such measures would require a complete build process overhaul I feel like.
- Loading branch information
Showing
4 changed files
with
107 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
#!/usr/bin/env node | ||
import workerpool from "workerpool" | ||
const cacheFile = "./.quartz-cache/transpiled-worker.mjs" | ||
const { parseFiles } = await import(cacheFile) | ||
const { parseMarkdown, processHtml } = await import(cacheFile) | ||
workerpool.worker({ | ||
parseFiles, | ||
parseMarkdown, | ||
processHtml, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters