1

My favicon is only showing up on the home page of my website.

It's located in the root directory of my repo on github and i've added the following lines to the head.html and _config.yml files respectively.

I've tried multiple paths and file names. When inspecting the source code on other pages on the site it seems to link the relative path with /favicon.png at the end.

The home page source leads to the favicon.

<link rel="shortcut icon" type="image/png" href="favicon.png">
plugins:
   - jekyll-feed
   - jekyll-seo-tag

Here's my head.html file:

<head>
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   {%- seo -%}
   <link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
   <link rel="shortcut icon" type="image/png" href="favicon.png">
   {%- feed_meta -%}
   {%- if jekyll.environment == 'production' and site.google_analytics -%}
     {%- include google-analytics.html -%}
   {%- endif -%}
 </head>

Should my favicon not show on every subpage and post on the site?

At present, it's only showing on the home page and not on any other page.

here's my repo: https://github.com/Redm0nd/redm0nd.github.io

The webpage is www.dylanredmond.me

nalydddd
  • 21
  • 4

1 Answers1

3

This issue can be fixed by adding a slash before favicon.png as below.

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

Without slash, favicon.png is related path so it is loaded from following path but it doesn't exist.

http://www.dylanredmond.me/jekyll/update/2019/04/30/favicon.png

y15e
  • 159
  • 5
  • Hm. It works for my main page without a leading slash, but not of the other pages. With a leading slash it doesn't work for any of the pages... I have my favicons in a subfolder `assets/favicon/`. – stefanbschneider Mar 24 '20 at 06:39