QuiltMC / quiltmc.org

The source for quiltmc.org
https://quiltmc.org
Other
58 stars 44 forks source link

Fix scripts running when they should not #217

Closed Pyrofab closed 2 months ago

Pyrofab commented 2 months ago

For the Swagger UI I used a dynamic import so the script gets split into its own chunk, and only gets loaded on the relevant page. For the installer version, the imported module is really small so a dynamic import was not needed. As for the "condition", I noticed the Astro doc was suggesting web components to implement custom behaviour, and I figured it would do a decent job at structuring the code, so I used this instead of a basic getElementById.

fixes #215 fixes #216


See preview on Cloudflare Pages: https://preview-217.quiltmc-org.pages.dev