Start a blog in 15 min.
May 28, 2020
How to start a blog in 15 min
Start with cloning the gatsby gatsby-starter-blog Template π
git clone https://github.com/gatsbyjs/gatsby-starter-blog.git
we got the template the next question is where to host, as hosting can be expensive and we are looking at a ~100-page static website. there is no need for hosting, here is where GitHub pages come to the rescue π₯. we will go in steps from now:
- Make a Github repo named username.github.io (this will be your domain) π
- Then make a remote with this repo from the cloned directory
- The tricky π© part is that GitHub only allows the master branch to launch the site (which means gh-page package wonβt work π’)
-
But worry not I have found a work around, Initialize git in the public directory in the cloned repo, If public directory not found run:
gatsby build
and then
cd public && git init
-
Add this to βscriptsβ in package.json file. so that you can deploy changes with a single command
npm run masterdeploy
"masterdeploy": `gatsby build && cd public && git add . && git commit -m 'default' && git push origin master`
- Make necessary changes to the repo to make it your own.
-
run this in terminal
npm run masterdeploy
- There is no step 8, You are all done
Happy blogging π
I will put customization I made in a later post stay tooned.