This is a simple static site generator that uses the wordpress.com REST API as a backend and publishes to an AWS S3 bucket. If you use CloudFront to serve / terminate TLS, it will issue an invalidation request.
It uses AWS API Gateway to provide a webhook, which is called whenever you publish or update a post (or page) on wordpress.com. It will look a lot like my blog, because that's what it is.
-
Copy
config.example.js
toconfig.js
and edit it. -
Create the webhook on AWS:
npm run setup
- Give the Lambda function permission to write to your S3 bucket.
npm run policy
- Add the webhook to your wordpress.com site for the following events:
publish_post
publish_page
When running locally, make sure your AWS credentials are available.
npm run publish
Alternatively, you can just POST
to your endpoint:
curl -X POST https://API_GATEWAY_ID.execute-api.AWS_REGION.amazonaws.com/latest/update