Author a static Web site locally in hexo, and publish directly to a Amazon Web Services’ S3 bucket. You’ll use hexo, a text editor, and the AWS CLI.
$ npm install -g hexo-cli
$ pip install awscli
$ aws configure
AWS Access Key ID [None]: <Valid Value>
AWS Secret Access Key [None]: <Valid Value>
Default region name [None]: <Valid Value>
Default output format [None]:
$ aws s3 ls
2015-03-09 00:34:31 yourfirstbucket
2015-03-09 03:41:21 bucket-for-logs
2015-03-09 15:03:30 yourwebsite.com
2015-03-09 14:55:14 www.yourwebsite.com
$ aws s3api get-bucket-website --bucket yourwebsite.com
{
"IndexDocument": {
"Suffix": "index.html"
},
"ErrorDocument": {
"Key": "error.html"
}
}
$ mkdir ~/yourwebsite.com
$ cd ~/yourwebsite.com
$ hexo init .
$ hexo new draft "My New Article"
INFO Created: ~/yourwebsite.com/source/_drafts/My-New-Article.md
$ hexo server --drafts --open
<CTRL-C to stop the hexo server>
$ hexo publish 'My-New-Article'
$ hexo generate
$ ls public
2017 css index.html
archives fancybox js
$ aws s3 sync public/ s3://yourwebsite.com/ --delete --sse