Last active
May 5, 2016 21:27
-
-
Save edrex/7492725 to your computer and use it in GitHub Desktop.
Upload static site to S3 with clean URLs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Be sure to set the index and 404 docs to "index" and "404" respectively in your bucket settings | |
# replace with your compile command | |
harp compile ./ ./out | |
# removes the html extension | |
for f in `ls out/*.html out/**/*.html`; do mv $f "${f%%.*}"; done | |
# requires s3cmd >= v1.5.0-beta1 for | |
# https://github.com/s3tools/s3cmd/issues/243 | |
s3cmd sync --default-mime-type="text/html; charset=utf-8" --guess-mime-type --delete-removed out/ s3://eric.pdxhub.org/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this scrip, @edrex!
I should mention that I couldn't get this to work in zsh on Mac OS X. It would rename all the files, stripping off the extension—didn't succeed in copying them into any new folders or renaming them to
index.html
Did you ever get this working as you expected? Seems like something more like the code below if necessary to accomplish what you wanted?
Edit
Looking back at the issues page, it seems someone posted this, which looks promising. I'll play around with it: