Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Ground Controller Lvl 1
Message 11 of 19

Re: index.html not working

I have added front matter part to the readme.md and it fixed the problem.
---
permalink: /index.html
---

After this it shows index.html. I have found this solution also helps for custom 404 pages. https://help.github.com/articles/creating-a-custom-404-page-for-your-github-pages-site/

Ground Controller Lvl 1
Message 12 of 19

Re: index.html not working

I have the impression this is a workaround but not a solution. If you access your site via github.com, you want the content of readme.md displayed, so people know, what this project is about. If people access your website via github.io, you want the content of index.html displayed. I was under the impression, that the right way to do this, is to exclude README.md from your website by including in your _config.yml:

exclude:

    - README.md

Now the problems seems to be, that this is not always working as it should.

Ground Controller Lvl 1
Message 13 of 19

Re: index.html not working

thanks this worked great!

Ground Controller Lvl 1
Message 14 of 19

Re: index.html not working

Thanks for the tip with the permalink.  It worked right away.

Ground Controller Lvl 1
Message 15 of 19

Re: index.html not working

FWIW, for those (other) newbs out there, I found that if you have an existing repo, what they don't mention in the GH Pages tutorial, is you just need to to go to settings in the repo, then scroll down to the Github Pages section, and then set the (master) branch (this is disabled by default), and save it.

This should create a page you can then goto in the browser. 

 EDIT: theme is optional - I left it off. 

 

See photos for visual guide. 

 

 

settings github.JPGset branch.JPG

Ground Controller Lvl 1
Message 16 of 19

Re: index.html not working

Thanks! This solved my problem! 

Ground Controller Lvl 1
Message 17 of 19

Re: index.html not working

I had the same problem and it was because I had an empty line before<!doctype html> in my index.html

Copilot Lvl 2
Message 18 of 19

Re: index.html not working

Thanks Louvivien! That was my issue as well--never would have solved it without your tip.

Ground Controller Lvl 1
Message 19 of 19

Re: index.html not working

I just had this exact same problem, but AFTER it was working

 

It happened because I had to reset the gh-pages branch. So I

  1. git branch -D gh-pages
  2. git push -d origin gh-pages

Then I had a script create an orphan branch gh-pages, populate it, and push it. Before this, everything worked without /index.html, but after, I had to add /index.html. I must have triggered a bug by accident.

 

The fix was was go into the settings and change the GitHub Pages Source branch to master, then back to gh-pages. This toggle was able to get around the bugged state I found myself in and everything is good again.