1

So I tried to setup a resume page for myself using this guide.

Repository is https://github.com/AtlasFontaine/AtlasFontaine.github.io and my custom domain is https://emirhanavci.me/

Now, I did everything according to the guide. Added homepage key to package.json and added CNAME to the root of the repository. But initially when I went to emirhanavci.me it displayed the README.md from master branch. So a quick search led me to this post. According to that post, I needed an index.html file in the root of my master branch. So I copied the index.html in the /public directory and pasted it to /. Now it only returns a blank page when I visit my domain. Also when I look at the original repository of the creator of this guide, I see that he doesn't have an index.html in his root anyway.

Since then I removed index.html and now I'm back to the beginning.

Where did I go wrong?

AtlasF
  • 13
  • 4

1 Answers1

0

So I copied the index.html in the /public directory and pasted it to /.

Your index.html must be in the project root folder (not in a subfolder like public/).

Basically, the document root folder is / and until your index.html is not moved there it will show the readme.md instead.

The problem with the browser response beeing blank is,

you are using node to run your project on localhost, but Github does not run node, instead, it is showing static (html) files.

Daniel W.
  • 31,164
  • 13
  • 93
  • 151
  • I did exactly that, I copied ```index.html``` to the root, where README.md is located. And it returns a blank page. I thought maybe problem is in the html file but everything looks okay. – AtlasF Mar 11 '20 at 18:25
  • @AtlasF Currently the index.html file is not in the master branch in `/` could you try again – Daniel W. Mar 11 '20 at 18:56
  • @AtlasF You have something wrong in your index.html file, the file itself is getting sent to the browser. You can verify that when you do right click and view source code or use the developers console. – Daniel W. Mar 11 '20 at 18:59
  • Now its in ```/``` again. I did this before and still returning a blank page – AtlasF Mar 11 '20 at 19:01
  • @AtlasF it's "blank" because you have errors in your file, the `%PUBLIC_URL%` things don't get parsed. Look into the source code! – Daniel W. Mar 11 '20 at 19:09
  • Thank you for giving your time! I'm convinced something wrong with the .html file at this point. But the fact that there's no problem when I command ```yarn start``` and it works on ```localhost``` confuses my mind. Shouldn't it be blank in local too if the problem is with the ```index.html```? – AtlasF Mar 11 '20 at 19:15
  • @AtlasF Github Pages is not using yarn/javascript! On your localhost, you have a node server, on Github you have just static HTML. So you must create a kind of build-step or put the pre-rendered files on Github. – Daniel W. Mar 11 '20 at 19:18