v79 / Cantilever

Creating a cloud-first static website generator using AWS servers such as S3 and Lambda. Transforms markdown files into HTML.
2 stars 0 forks source link

Create a route to clear the generated bucket for a project, to free up space. #88

Closed v79 closed 6 months ago

v79 commented 7 months ago

For a given project, remove HTML and image files from generated bucket.

Delete the contents of the "htmlFragments" and "images" folders for the given project domain key.

v79 commented 7 months ago

If I delete all the images from the generated bucket, but those images are still existing in the project sources, this will cause problems. So the clearGeneratedImages function should only remove images which are not declared in metadata.json.

This isn't a problem for htmlFragments, as they will always be rebuild from source during page generation.

v79 commented 6 months ago

My S3Service listObjectsDelim function doesn't work as I expected - check https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_ResponseSyntax for details of 'Delimiter'. Just use listObjects with a better prefix instead?