Skip to content
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

Merged
merged 3 commits into from
Dec 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/docs/deploy-gatsby.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,20 @@ The repository for these sites requires a special name. See
https://help.github.com/articles/user-organization-and-project-pages/ for
documentation on naming your site's repository.

If you wish to use custom domain with your `user.github.io` repo, you will need
a `CNAME` file at the root directory level with the your custom domain url inside,
like so:

```
example.com
```

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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 😞

}
```

Expand Down