Skip to content

Commit

Permalink
Support favicon for desktop, android and iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
probberechts committed Nov 25, 2016
1 parent 1629797 commit 3ebe5fb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ customize:
width: 50
height: 50
url: /images/logo.png
favicon: /images/favicon.png # path to favicon
favicon:
# eg. generate with http://realfavicongenerator.net/
desktop: /images/favicon.ico
android: /images/favicon-192x192.png
apple: /images/apple-touch-icon.png
social_links:
github: http://github.com/probberechts/cactus-dark
twitter: /
Expand Down
10 changes: 9 additions & 1 deletion layout/_partial/head.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
}) %>
<%- meta(page) %>
<% if (theme.customize.favicon) { %>
<link rel="icon" type="image/png" href="<%= url_for(theme.customize.favicon) %>" sizes="32x32" />
<% if (theme.customize.favicon.desktop) { %>
<link rel="shortcut icon" href="<%= url_for(theme.customize.favicon.desktop) %>">
<% } %>
<% if (theme.customize.favicon.android) { %>
<link rel="icon" type="image/png" href="<%= url_for(theme.customize.favicon.android) %>" sizes="192x192">
<% } %>
<% if (theme.customize.favicon.apple) { %>
<link rel="apple-touch-icon" sizes="180x180" href="<%= url_for(theme.customize.favicon.apple) %>">
<% } %>
<% } %>
<!-- title -->
<title><%= page.title ? page.title : config.title %></title>
Expand Down
Binary file added source/images/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/favicon-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/favicon.ico
Binary file not shown.
Binary file removed source/images/favicon.png
Binary file not shown.

0 comments on commit 3ebe5fb

Please sign in to comment.