-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for gh-pages
remove CNAME file for custom domain
#3160
Conversation
Deploy preview ready! Built with commit dfddbf2 |
Deploy preview ready! Built with commit ea1469d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for improving the docs here! Just make the change to suggest using the static folder and I'll merge this.
docs/docs/deploy-gatsby.md
Outdated
Like with project sites, add `gh-pages` as a `devDependency` and add a `deploy` | ||
script to your site's `package.json` file: | ||
|
||
``` | ||
"scripts": { | ||
"deploy": "gatsby build && gh-pages -d public --branch master", | ||
"deploy": "gatsby build && cp CNAME public/ && gh-pages -d public --branch master", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recommend using the static
folder for this — https://www.gatsbyjs.org/docs/adding-images-fonts-files/#using-the-static-folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Kyle, that would mean the CNAME file would be under the static/
folder, for custom domain to work, CNAME
has to be under the root folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BODAZ Files you place in you project static
directory are copied to root output directory /public
(not /public/static
) so it's perfect place for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pieh 👍 thanks, I misread the docs 😞
Thanks! |
Hiya @BODAZ! 👋 This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here. Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! 💪💜 |
So many people struggles with the fact
gh-pages
remove CNAME file inpublic
directory, see these open issues.If the user wants to use custom domain for their
user.github.io
, then the change in thepackage.json
script will avoid this issue.