#How do I edit an already built site?
8 messages · Page 1 of 1 (latest)
You'll need to make your edits then rebuild and redeploy
@serene cloak depending on where you're hosting, some providers make this process pretty easy with GitHub integrations. You can make your changes locally, commit and push them to GitHub, and your site is automatically rebuilt and redeployed. Just make sure to use astro dev locally to make sure the changes look right before having it redeployed!
in SSG, the site is built in the out folder e.g. .dist by default. You can edit the generated html files there directly, but it is not a good idea, best is to do changes "before building" on your sources and not "after building".
if I may ask what pushes you to do changes after not before build ?
Thanks! I forgot to save the already built site after building it, thats why I need to do the changes after build sadly
I don't get it. You don't need to save the build, because you can always build it again. That does not explain why you want changes after build not before.
If you have ISR Incremental Static Regeneration in mind (Incremental Build) that's not supported.
@serene cloak like @jovial obsidian said, it's best practice to hang onto your source files but not really care about the build directory. One reason for this is to have what's called a single source of truth, where we can guarantee the output (built files) is a direct result of the input (source files). Once we start editing the built code, this principle breaks and causes issues. Subsequent builds also need to be manually edited, or they'll be missing certain features. Makes it a little bit more error prone
I don't even wanna call this method "best practice" because it's really the only way it should be done. But your workflow should start with source files, making changes there as needed, and then recompiling the output