How Gridsome works with GitHub Pages
2 min readMay 6, 2019
Gridsome is Vue flavoured and a powerful static site generator. It’s the Gatsby alternative for Vue. It is data-driven meaning it uses a GraphQL layer to get data and dynamically update pages from it.
Features of Gridsome
- Fast by default ⚡️
- It’s PWA ready 🚀
- Prefetching 💪
- Code Splitting done automatically ✂️
The quickest way to put Gridsome site to GitHub Pages is by using a package — gh-pages.
npm i gh-pages -D
Add a publish script to your package.json
{
"scripts": {
"deploy": "gridsome build && gh-pages -d dist"
}
}
In the gridsome-config.js, add your repository name as path prefix
module.exports = {
pathPrefix: '/path',
}
When you run npm run deploy all the contents of the build folder will be pushed to your repository’s gh-pages branch.