Favicon with GitHub Pages

Rokin picture Rokin · Jan 27, 2016 · Viewed 12.6k times · Source

I'm hosting a few sites with GitHub Pages (User and Project Pages), but they are not displaying their favicons (in the browser).

<link rel="shortcut icon" type="image/png" href="/favicon.png">

Is the problem that GitHub displays the site with <frameset>? I know it's possible to display favicons (at least with Jekyll), but can I display a favicon on it's own?

Answer

Dmitry Pleshkov picture Dmitry Pleshkov · Mar 23, 2017

Yes, you can.

Put this into the head part of your webpage:

 <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">

It is important to not put the slash before the favicon.ico part. Put the favicon.ico file in your repository's home directory.