The initial sources for how we built this blog
Deploying:
yarn run deploy
Github pages:
~~We used the method detailed within Jared Nielsen's blog. The only change we made was that we deploy to the gh-pages branch rather than the deploy branch. All we had to do was change the deploy: script: within package.json so that the deploy branch is gh-pages rather than deploy:
"scripts": {
...
"deploy": "gatsby build --prefix-paths && gh-pages -d public -b gh-pages"
},
<!-- gh-pages is an npm library that publishes files to whichever branch you want -->
Within our repo we also had to change the GitHub Pages settings source to gh-pages branch, here
~~
Netlify
Netlify will auto-deploy. We currently set netlify auto-deploy to run from the public folder on the master branch.
Compared to the gh-pages deploy method we had to allow the public folder in .gitignore
Deploy steps:
- make whatever code changes you want
yarn run deploy- this adds the deployed code to thepublicfolder locallygit commit -a -m 'commit message'git push- netlify auto-deploys from there
Initial coding
We used the gatsby-blog started and then added the packages from the Gatsby Tutorials so that we could add some better styling and add markdown to our blog. The packages we added were:
- gatsby-source-filesystem
- gatsby-transformer-remark
- gatsby-plugin-emotion
- gatsby-plugin-typography
- gatsby-transformer-sharp