Yarn instead of NPM is required.
# install dependencies
yarn install
# serve with hot reload at localhost:8000
yarn start
# run production build
yarn run build
Notice that a dependency sharp needs to pull prebuilt binaries from GitHub releases during installation. However, GitHub hosts release files on AWS, which is blocked in China. Failure to download these files will cause failure in installation and following steps.
To successfully download these files, follow these steps:
- Download the file yourself
- Upload the file into a cloud service (I use qiniu storage) and get the URL, which needs to be accessible from Internet
- Set the environment variable
SHARP_DIST_BASE_URL
to the URL without the filename itself - Disable your proxy! (important if you are using shadowsocks)
yarn install
and you are ready to go!
You may use http://olaviw8n8.bkt.clouddn.com/
as the BASE_URL to test but be sure to change it as long as you upload it yourself.
See the official docs about changing the base url for the binary.
Before deploying, npm run build
first!
npm run deploy
will
- rename to
./docs
- write in CNAME
Then push to master. GitHub will publish the website.
Built with Gatsby - the blazing-fast static site generator for React.