Skip to content

Improvements to favicon handling #572

@Tachi107

Description

@Tachi107

Hi!

The theme currently has a pretty simple favicon handling:

<!-- Icons -->
<link rel="shortcut icon" href="{{ "favicon.png" | absURL }}">
<link rel="apple-touch-icon" href="{{ "apple-touch-icon.png" | absURL }}">

In my site, I'd like to serve:

  • An ICO file (of media type image/vnd.microsoft.icon)
  • An SVG file
  • An apple touch icon (of media type image/png)

So, the head should contain something like this:

<link rel="icon" type="image/vnd.microsoft.icon" sizes="256x256 192x192 128x128 96x96 64x64 48x48 40x40 32x32 24x24 16x16" href="/favicon.ico">
<link rel="icon" type="image/svg+xml" sizes="any" href="/favicon.svg">
<link rel="apple-touch-icon" type="image/png" sizes="180x180" href="/apple-touch-icon.png">

Could the theme automate this in any way?

Also, I think that adding a type attribute to the already existing link elements could be done now without really any downside or added complexity. shortcut could be dropped too.

For more info about this topic, please see the IANA registry for link relation types, https://www.iana.org/assignments/link-relations/link-relations.xhtml, and the HTML standard, https://html.spec.whatwg.org/dev/links.html#rel-icon.

Bye!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions