Use other than index.html for Github pages

寵の児 提交于 2020-06-12 05:52:18

问题


I have recently started using github pages and so far I am using the default index.html as my main page. How do I use another page as my default page? For example if in my gh-pages branch I have my html in a folder src/. How do I set ./src/index.html as my default instead of ./index.html?


回答1:


Create dummy index.html and put this in the header

<meta http-equiv="refresh" content="0; url=http://mysite.github.io/folder/index.html" />

Change http://mysite.github.io/folder/index.html to your desired url.




回答2:


I though Steven Penny's comment was good, but on Windows it was not super straightforward to create a symlink inside git. Only more recent versions of git-for-windows support symlinks.

If you enable support via the core.symlinks config variable you can mklink index.html src\file.html and gh-pages will show file.html as the landing page.



来源:https://stackoverflow.com/questions/27330188/use-other-than-index-html-for-github-pages

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