Skip to content

Instantly share code, notes, and snippets.

@donrestarone
Last active February 3, 2021 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donrestarone/1de36bb897e93703f66b9b362e4e55f3 to your computer and use it in GitHub Desktop.
Save donrestarone/1de36bb897e93703f66b9b362e4e55f3 to your computer and use it in GitHub Desktop.
dynamically render favicons for a variety of sizes
<%= favicon_link_tag asset_path('your logo path') %>
<% %w(32 128 76 120 152 167 180 192 196).each do |size| %>
<%= favicon_link_tag "/icons/your-logo.png", rel: 'apple-touch-icon', type: 'image/png', sizes: "#{size}x#{size}" %>
<% end %>
<% %w(16 32).each do |size| %>
<%= favicon_link_tag "/icons/your-logo.png", rel: 'icon', type: 'image/png', sizes: "#{size}x#{size}" %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment