GitHub pages only showing ReadMe file?

前端 未结 6 1289
北海茫月
北海茫月 2020-12-15 21:08

I\'m trying to host my webpages into Github pages but for some reason it seems to only show my Readme file.

GitHub repo: https://github.com/InquisitiveDev2016/Inquis

相关标签:
6条回答
  • 2020-12-15 21:55

    The steps to resolve this issue is from best practice is to go the your project folder. You should change what ever you named your root or initial page to index.html as mentioned above. Then open your project in git bash on your system, perform your normal git steps like,

    • git add
    • git commit -m " change to index.html"
    • git push origin master {depending on what you named your root branch}

    Then go to settings and there you go (wow wow) after one or two refresh, your site will be live

    0 讨论(0)
  • 2020-12-15 22:02

    GitHub Pages is doing what it is designed to do: hosting that entire repository. The root of the repository only contains a single file (README.md). Other pages are there, e.g. https://inquisitivedev2016.github.io/Photo%20Website/webpage.html, but there isn't an easy way to navigate to them.

    Consider moving your web content into the root of your repository and renaming your default page to index.md or index.html, depending what type of file it is. (By convention the default page of most websites is called index.html, and this is what GitHub Pages will show by default if it exists.)

    0 讨论(0)
  • 2020-12-15 22:06

    Github gives you multiple choices where it takes it sources from. By default its the root of the master branch, which will use the README.md in case there is no index.html.

    But you can also switch to the docs/ folder in your repository settings. With that you can put the index.html under the docs/ folder.

    See

    0 讨论(0)
  • 2020-12-15 22:06

    Create an index.html in the root and insert the line

    <meta http-equiv="Refresh" content="2; url=public/index.html">
    

    Or so it worked for me with a Vue CLI project I had this trouble with.

    0 讨论(0)
  • 2020-12-15 22:11

    The simplest solution to overcome this is put the index.html file in the outermost folder along with the readme.md

    0 讨论(0)
  • 2020-12-15 22:13

    Please change the HTML file to index.html. This simple thing had me struggling for 6 hours to find this. My HTML name before was base.html; this shows the read me file only. After changing to index.html the file opened without any problems.

    0 讨论(0)
提交回复
热议问题