刘凡 9ff4d1d109 add S3,archive,truncate 2 years ago
..
.gitignore 9ff4d1d109 add S3,archive,truncate 2 years ago
LICENSE 9ff4d1d109 add S3,archive,truncate 2 years ago
README.md 9ff4d1d109 add S3,archive,truncate 2 years ago
amazon-s3-upload-static-site.py 9ff4d1d109 add S3,archive,truncate 2 years ago
requirements.txt 9ff4d1d109 add S3,archive,truncate 2 years ago

README.md

amazon-s3-upload-static-site

Uploads a static site, such as a Jekyll generated site, to Amazon S3, with built in pretty url handling.

Usage

python amazon-s3-upload-static-site.py --bucket s3_bucket_name --dir /path/to/directory/to/upload

Notes

The upload directory defaults to "_site" in the current working directory.

Pretty URLs: For .html files, a second file will be upload without the .html extension. The file will be uploaded with the "text/html" content type, so that I can have pretty URLs with my Amazon S3 hosted static websites.

Example: The local file about.html will be upload to the S3 bucket as both about.html and "about". The "about" file has no .html extension, but the text/html content type is set, allowing Amazon S3 to serve the file as HTML. Otherwise, the file will default to the "binary/octet-stream" content type, and the browser will attempt to download it rather than render it.