twostraws / Ignite

A static site generator for Swift developers.
MIT License
985 stars 34 forks source link

Added favicon support for safari #19

Open Mcrich23 opened 1 month ago

Mcrich23 commented 1 month ago

As with favicon support before (#8, #9), safari was not supported. This pr should fix that.

twostraws commented 4 weeks ago

This has been sitting waiting review for a while, which is my fault – I got into a bit of a rabbit hole on what exactly modern favicon support looks like, and in doing so even updated https://www.hackingwithswift.com to include the latest recommended approach. It's hard to get a great answer because so much just seems to be 10 years old, but from what I can see a good approach is:

  1. Using an SVG for the main favicon
  2. Using a 180x180 PNG for the Apple touch icon

I have no idea whether using 1 automatically makes 2 work, because if it doesn't it really ought to!

However, I'm wondering whether a better solution might work here: can we detect what favicon files they have in their Assets folder, and use that to generate all the correct tags automatically?

Mcrich23 commented 4 weeks ago

we can. I was looking at this as well and apple requires an extra metatag for safari. Thats what this pr is for. If you want me to, I can set it to auto look for favicon.png/svg/jpeg, and then people can override it if they choose.