The instructions say: You can configure a custom domain with GitHub Pages by adding a CNAME file to the public/ folder. I tried adding the public folder to my repo's root and to src, folder, but there's no CNAME in my build folder still.. what's the correct place for it?
Can you tell us which version of react-scripts are you using? (npm ls react-scripts)
The public folder should already be existed. I have noticed that you need to add the public folder to your repo's root, does that mean there is no 'public' folder already?
I have, [email protected], don't recall if I've deleted such a folder though. I could try to re-initialize the project and move the current code there...
It seems I have moved the favicon.ico to src and the index.html from the public folder _crapp_ created -- this is not okay probably?
I see. The issue is that in 0.5.0 we had a breaking change, which introduce the public folder (detail).
Please update your react-scripts. You can follow the migration guide to keep your current code base, one by one. You can also re-init a new app and move your code base there, but it is not really safe. Do the migration is a lot safer.
Will do, thanks!
Seems like it got resolved.
Does anyone have an example CNAME file used in this context? Thanks.
@alex-wilmer the CNAME file should just be verbatim the address in your DNS record that points to github via CNAME.
e.g. blog.example.com or example2.com
You can find more information here (which suggests you might not even need a CNAME file, don't quote me tho): https://help.github.com/articles/using-a-custom-domain-with-github-pages/
@Timer thanks for the response. If you can suggest a better venue for troubleshooting this I would be happy to move there. I always seem to have trouble wrapping my head around DNS.
the file
does it need to be named something in particular? or literally a file called CNAME ?
This is the site on github pages http://torontojs.github.io/torontojs.com/
The domain is torontojs.com and www.torontojs.com (through goDaddy I believe? I'm communicating with owner of the account intermittently)
If I'm correct, the current CNAME record on godaddy is pointing to torontojs.github.io (which may or not be sufficient?). I followed the instructions in the link you pasted earlier but the app is trying to resolve the bundle in the wrong location.
It should just be a file named CNAME, no extension, with www.torontojs.com in the file. If you don't want to use this approach you can follow these instructions.
echo "www.torontojs.com" > CNAME should do the trick
@Timer thank you very much! That indeed did the trick. In case anyone else needs to see an example https://github.com/torontojs/torontojs.com/tree/gh-pages
The other required step (for me) was updating my homepage key to
"homepage": "https://torontojs.github.io",
Most helpful comment
@Timer thank you very much! That indeed did the trick. In case anyone else needs to see an example https://github.com/torontojs/torontojs.com/tree/gh-pages
The other required step (for me) was updating my
homepagekey to