Content Layer API inserts scripts from all collection entries into every generated page #12024
Labels
- P4: important
Violate documented behavior or significantly impacts performance (priority)
feat: content layer
Related to the Content Layer feature (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Switched to Content Layer API, having content collections with
mdx
files that include and call various [astro] components in their content.[astro] components can have scripts and styles.
When browsing website, I see scripts basically from all components included and executed on every page, even if they are not part of given page content.
What's the expected result?
Only those assets should be part of the page that are included in content or template. This worked with
Content Collections
.Link to Minimal Reproducible Example
Participation
The text was updated successfully, but these errors were encountered: