Skip to content

Instantly share code, notes, and snippets.

@Bachana123
Last active December 6, 2019 07:41
Show Gist options
  • Save Bachana123/d7f20ea56667dc48d684ead21702e5a3 to your computer and use it in GitHub Desktop.
Save Bachana123/d7f20ea56667dc48d684ead21702e5a3 to your computer and use it in GitHub Desktop.
fav icon meta
const favicon = require('./config/favicon')
head: {
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
...favicon.meta
],
link: [
...favicon.links
]
},
/// in js file
const links = [
{ rel: "apple-touch-icon-precomposed", sizes: "57x57", href: "/images/favicon/apple-touch-icon-57x57.png" },
{ rel: "apple-touch-icon-precomposed", sizes: "114x114", href: "/images/favicon/apple-touch-icon-114x114.png" },
{ rel: "apple-touch-icon-precomposed", sizes: "72x72", href: "/images/favicon/apple-touch-icon-72x72.png" },
{ rel: "apple-touch-icon-precomposed", sizes: "144x144", href: "/images/favicon/apple-touch-icon-144x144.png" },
{ rel: "apple-touch-icon-precomposed", sizes: "60x60", href: "/images/favicon/apple-touch-icon-60x60.png" },
{ rel: "apple-touch-icon-precomposed", sizes: "120x120", href: "/images/favicon/apple-touch-icon-120x120.png" },
{ rel: "apple-touch-icon-precomposed", sizes: "76x76", href: "/images/favicon/apple-touch-icon-76x76.png" },
{ rel: "apple-touch-icon-precomposed", sizes: "152x152", href: "/images/favicon/apple-touch-icon-152x152.png" },
{ rel: "icon", type: "image/png", href: "/images/favicon/favicon-196x196.png", sizes: "196x196" },
{ rel: "icon", type: "image/png", href: "/images/favicon/favicon-96x96.png", sizes: "96x96" },
{ rel: "icon", type: "image/png", href: "/images/favicon/favicon-32x32.png", sizes: "32x32" },
{ rel: "icon", type: "image/png", href: "/images/favicon/favicon-16x16.png", sizes: "16x16" },
{ rel: "icon", type: "image/png", href: "/images/favicon/favicon-128.png", sizes: "128x128" }
]
const meta = [
{ name: "msapplication-TileColor", content: "#FFFFFF" },
{ name: "msapplication-TileImage", content: "/images/favicon/mstile-144x144.png" },
{ name: "msapplication-square70x70logo", content: "/images/favicon/mstile-70x70.png" },
{ name: "msapplication-square150x150logo", content: "/images/favicon/mstile-150x150.png" },
{ name: "msapplication-wide310x150logo", content: "/images/favicon/mstile-310x150.png" },
{ name: "msapplication-square310x310logo", content: "/images/favicon/mstile-310x310.png" }
]
module.exports = {
links,
meta
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment