Skip to content

Two full rendering required when used as content collection #14

@crd2333

Description

@crd2333

I'm not familiar with astro or anything about frontend, but I noticed one thing:
Each time I use pnpm build to build the site, the console.debug(`Detecting ${id}`) in target definition appears twice. And one in [content] Syncing content, the other in [build] Building static entrypoints....

I see some code like this let { getFrontmatter } = await renderToHTMLish(...). It seems getting the frontmatter info also needs rendering the full typst file to html (or svg?). This seems reasonable as typst's metadata is more flexible than markdown's text.

But this is extremely annoying when the file number and size get increased, where my build operation reached the max size of memory and crashed (even though I have tried to enlarge the max-old-space-size, maybe my file is too large XD)...

Trying to split the files maybe is able to solve the problem, but one file requiring two rendering is anyway an awful thing. I really appreciate your great work. Do you have any idea about the problem? Like "caching the first rendering for the next" / "caching the metadata to jump some rendering", etc?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions