gatsby-plugin-manifest is awesome both for creating manifest.webmanifest files and also generating icon sets for a site. Unfortunately Apple still doesn't support icons defined in a manifest file and needs <link> tags. That makes the icon feature of plugin-manifest only useful for Android PWAs. It would be great if plugin-manifest could write the relevant meta tags for icons (both Apple and favicons) to HTML as well.
To avoid a breaking change you'd probably want this opt-in, something like a writeHTML: true option.
This would mean you could feed a single icon file to plugin-manifest and have everything taken care of for you. Right now you still need to manually set icons for the use-cases that don't support an icon manifest (web and iOS).
Granted that automatically handling all this icon stuff for you is slightly outside the scope of a strict 'manifest' plugin, but so is generating icons in the first place. So might as well go all the way and do it properly.
Oh, didn't know that! Yeah, this would be great to change. Since this is a feature addition and we wouldn't be changing any existing behavior, it's not a breaking change. We can just start adding the meta tags to people's sites.
Would you like to put together a PR adding support for this?
I was more thinking breaking in the sense that you'd start automatically tampering with their <head> (eg: overriding any manually defined icons they already had, if plugin-manifest runs after Helmet or whatever they're using). Though I guess that's a grey area, bumping a minor would probably cover it.
Sure I can take a stab, super new to Gatsby though so would have to do some digging on how plugins actually work haha. If anyone else more familiar with gatsby's innards wants to submit a PR in the meantime go for it.
Ah, yeah that would be a breaking change. Hmmm yeah, not too big of deal though incrementing a major version. I really dislike adding a config option for something everyone would want.
@seaneking I had originally planned to do this but didn't have time before heading out on my current endeavor. Glad someone is able to help with this.
Once you get into the code for this it should be fairly simple. I have really limited internet access but I will try and answer any questions if you have any.
I'd be in favor of a config option that defaults false so folks have to explicitly turn on apple compatibility and favicon support.
PS/fyi - saffari is working on webapp support, not sure when it'll be complete. If you look at my original pr for this feature I think I laid out all the current support by browser at the time. Safari Mac also has its own weird thing that's different then mobile devices.
Wouldn't count on Safari shipping support for manifest icons any time soon - they may, they may not, there's no way to know. Don't have the best track record with community transparency in these things.
I'd echo @KyleAMathews that (if we're happy with a major ver) apple icons shouldn't be a config option, since that's just getting parity with the manifest icons this already does automatically. Favicons I could see an argument for either way.
I'm pretty flat out atm myself, but will see if I can get to this some time in the next couple of weeks.
Sounds good. Well if you or anyone else doesn't get to it by October when I'm back in civilization I'll probably work on it.