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

我的梦境 提交于 2019-12-10 18:51:56

问题


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:

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?


回答1:


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.



来源:https://stackoverflow.com/questions/38710488/how-can-i-change-my-github-pages-default-index-html-location

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!