Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change my Github Pages default index.html location?

I already tried what's shown on the following threads:

Can I have my Github Pages index.html in a subfolder of the repository?

possible to change where github pages looks for index.html?

Basically, running git subtree push --prefix public origin gh-pages doesn't do anything and I still get a 404 error on my site (located here). You can find my site's structure here.

Here is my Github Pages configuration: enter image description here

Also, a possibly important note: my site is being deployed from the master branch, not the gh-pages one (it didn't even exist before running the command above)

Any ideas?

like image 777
sgarcia.dev Avatar asked Nov 09 '22 11:11

sgarcia.dev


1 Answers

If what you are asking is how to store the site code in gh-pages instead of master, then you can do this using a repo name that isn't username.github.io.

Using username.github.io tells GitHub pages that your site code will be in the master branch.

Simply use a normal repository name, and then you will be able to store the code in gh-pages.

It shouldn't be an issue for you since you are using a custom domain anyway, but your github.io url would like like http://username.github.io/repo_name.

For example, in a normal non username.github.io repo, the GitHub settings page will tell you:

To update your site, push your HTML or Jekyll updates to your gh-pages branch.

This will allow you to run the site off of the gh-pages branch.

like image 117
tehp Avatar answered Nov 15 '22 05:11

tehp