CorrelAid / correlaid_website

Source code for the CorrelAid website
https://correlaid.org
3 stars 0 forks source link

Static build should include all assets #505

Closed KonradUdoHannes closed 4 months ago

KonradUdoHannes commented 10 months ago

The static build does currently not include all assets. The concrete example I noticed are images of People, which are still fetched from the cms. This means they are not available if the cms is unavailable.

It would be more consistent if the static build also includes the assets for the webpage.

This is not critical as assets are less important for the functionality of the website, but they are still very important for its appearance.

KonradUdoHannes commented 10 months ago

This seems to be less straight forward then I initially thought. Sveltekit offers to import assets stored in the project from $lib/assets, but the difficulty for including all the assets in a static build would then be to determine all the assets that need to be included, which is dynamic based on other content.

jstet commented 9 months ago

from time to time i worry about the stability of our directus instance (btw we should probably update the directus version sometimes and add some kind of monitoring idk) and decoupling images from it would reduce my worries :D

jstet commented 8 months ago

Images are fetched remotely, so we would have to find some way to download the images and also change the src attribute

jstet commented 5 months ago

https://kit.svelte.dev/docs/images

https://kit.svelte.dev/docs/adapter-static

https://www.npmjs.com/package/@ivorgri/sveltekit-pluggable-static-adapter-external-image-plugin

jstet commented 5 months ago

I think the best approach is to write a npm postbuild script to modify the output of the build