![]() ![]() To address this, use the -f option from the gh-pages command to avoid keeping an history of the GitHub Pages branch. This might slow down operations like clone and increase disk usage. ⚠️ As your repository will grow and get more commits, so will your gh-pages branch. If you don’t have a main or gh-pages branch, you can create them and then return to source settings to change your publishing source. Note: To select main or gh-pages as your publishing source, you must have the branch present in your repository. Make sure that your repository’s settings has the gh-pages branch set as the source to deploy from. When you run npm run deploy all contents of the public folder will be moved to your repository’s gh-pages branch. Then add a deploy script to package.json in your repository’s codebase: You’ll need to add your /reponame path prefix as an option to gatsby-config.js: Specific instructions Deploying to a path with pathPrefixįor sites deployed at a path like /reponame/, the -prefix-paths flag is used because your website will end up inside a folder like /reponame/. See the instructions below how to configure it (as it depends on what option you’ll choose). This will make it easier to publish your Gatsby site to GitHub pages. You can add a custom deploy script to the "scripts" section of your package.json. The best way to push a Gatsby app to GitHub Pages is by using a package called gh-pages.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |