Ghost: Custom favicons not working in 1.0

Issue Summary

Custom favicons are no longer working.

I’ve looked in the admin panel to make sure the favicon isn’t configured there, but I don’t see anything of the sort, only a way to upload a much larger “Publication Icon”.

Two separate issues:

  • {{ asset "/favicon.ico" }} does not correctly source the theme favicon anymore. I would expect this to return /assets/favicon.ico, but it instead returns /favicon.ico.

  • Further, {{ ghost_head }} is adding another line of the default favicon to the page.

I can’t seem to override it, regardless of whether I put a hard-coded <link rel="shortcut icon" href="/assets/favicon.ico" type="image/x-icon"> before or after {{ ghost_head }}.

Steps to Reproduce

Try to use {{ asset "/favicon.ico" }} to serve a custom favicon from the theme assets.

Technical details:

  • Ghost Version: 1.0
  • Node Version: 6.9.5
  • Browser/OS: Chrome/OSX
  • Database: mysql

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (7 by maintainers)

Most upvoted comments

Okay, thank you both for clarifying.

I will say, it’s entirely non-obvious based on the admin panel. There doesn’t seem to be any indication there or in the documentation that the Publication Icon is what you need to upload to display a custom favicon.

I pushed the method implementation suggested by @aphe which is fixing the problem. Actually pushed on the mmornati repo. I will push on the seth one too (I think we will keep only one repo).

I’m using custom storage (Cloudinary), favicon shows correctly in admin under ‘Publication Icon’ (src is https://res.cloudinary.com/…), but on site it renders as

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

This is expected - /favicon.png is a special route that will load the saved image from storage engine when there’s a custom icon otherwise render or redirect to the default icon.

As @kirrg001 mentioned above, the ghost-cloudinary-store storage engine has not implemented all of the required storage engine methods.

This is because the custom storage adapter you are using has not implemented the read method, see. It’s documented here.

@kirrg001 thank you for the info.

As of Ghost 1.0, {{ghost_head}} automatically outputs the favicon code for you. Any code like {{ asset "/favicon.ico" }}should be removed from your theme.

I’ve added a section in the migration guide of the docs to cover this, and also opened an issue to add a check for this to GScan

P.S. Also note favicons are EXTREMELY heavily cached by browsers. If you don’t see it update please check it on a different device first.