Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Favicon support with :icon #62

Closed
rmm5t opened this issue Aug 14, 2014 · 4 comments
Closed

Favicon support with :icon #62

rmm5t opened this issue Aug 14, 2014 · 4 comments

Comments

@rmm5t
Copy link

rmm5t commented Aug 14, 2014

Would an :icon option be of value to this gem? If so, I'm willing to submit a pull-request for it.


Defaults to "image/x-icon":

set_meta_tags icon: "/favicon.ico"
<link href="/favicon.ico" rel="icon" type="image/x-icon">

Supporting different mime types:

set_meta_tags icon: { "image/png" => "/images/icon.png" }
<link href="/images/icon.png" rel="icon" type="image/png">
@zrisher
Copy link

zrisher commented Aug 16, 2014

That would be useful to me, especially if it supported the sizes attribute:
sizes="16x16 32x32" or sizes="228X228"

and different values for rel:
apple-touch-icon, apple-touch-icon-precomposed to specify a precomposed version for < iOS7.

Per these sources 1,2,3, we don't need an IE statement since we can include favicon.ico in the site root at public/.

Maybe the easiest way to do this would be a hash that takes the value for each attribute?

set_meta_tags icons: [
  { href: '/images/icons/icon_96.png', rel: 'icon', sizes: '32x32 96x96', type: 'image/png' }, 
  { href: '/images/icons/icon_itouch_precomp_32.png', rel: 'apple-touch-icon-precomposed', sizes: '32x32', type: 'image/png' }, 
  ...etc...
]

We can support newer IE tiles with the existing custom tag functionality.

@rmm5t
Copy link
Author

rmm5t commented Aug 17, 2014

@zrisher Some good suggestions, but I don't really want this to be just a direct mapping to the <link> tag.

Support for apple-touch-icon is a good idea too, but I think we should just let precomposed die off. It's deprecated afterall.

@zrisher
Copy link

zrisher commented Aug 17, 2014

@rmm5t Ok agreed support for precomposed is probably unnecessary.

Supporting type is probably unnecessary too, since the only time you'd need a type other than image/png is if you're providing an ico file to non-IE browsers (which don't necessary look in root). That's a sub-optimal choice compared to giving them resolution-targeted png files that only include the necessary data for that browsing environment. I guess someone might want to use jpg's since they're smaller at larger resolutions, but they're lossy and it's unlikely to save much space for favicons.

@kpumuk
Copy link
Owner

kpumuk commented Aug 20, 2015

Added in d321be1

@kpumuk kpumuk closed this as completed Aug 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants