#
Hiking - Gatsby
#
Project summary
Recording my hiking adventures in Singapore using Gatsby.
#
🌐 Page
#
Github repository
#
Setup guide
The setup and deploy guide is up to date with version 2.25.3
- Install Gatsby:
npm install -g gatsby-cli
- Initialization:
gatsby new <name> https://github.com/gatsbyjs/gatsby-starter-blog
- Run Gatsby:
gatsby develop
#
Deploy to Github Pages
#
Prerequisites
- Install Github Pages package
npm install gh-pages --save-dev
- Add
pathPrefix
to yourgatsby-config.js
.
./gatsby-config.js.
module.exports = {
pathPrefix: `/<repo>`,
}
- Add
deploy
topackage.json
.
./package.json
{
"scripts": {
"deploy": "gatsby build --prefix-paths && gh-pages -d public"
}
}
- Go to Github Pages at
https://github.com/<github_user>/<repo>/settings/pages
. - Select
gh-pages
branch with/(root)
and save.
#
Deployment
Run the following:
npm run deploy