From 4bc8a6f73a6165022d1fbeee8b0336680a1a8d21 Mon Sep 17 00:00:00 2001 From: Aaron Gutierrez Date: Sat, 26 Jan 2019 18:46:49 -0800 Subject: [PATCH] strip html --- pub.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pub.py b/pub.py index e5c925a..15a3866 100755 --- a/pub.py +++ b/pub.py @@ -42,6 +42,15 @@ def upload_file(filename, overwrite=True): 'ContentType': TYPE_MAP[ext], 'CacheControl': 'public, max-age={}'.format('31536000' if ext in ['gif', 'jpg', 'png', 'webp'] else 86400) }) + + if (ext == 'html'): + # Also upload the file without .html + s3.upload_file(filename, BUCKET, filename[:-5], ExtraArgs={ + 'ACL': 'public-read', + 'ContentType': TYPE_MAP[ext], + 'CacheControl': 'public, max-age={}'.format('31536000' if ext in ['gif', 'jpg', 'png', 'webp'] else 86400) + }) + print('\tDone.') def filter_filenames(filenames, ext):