feature_request(paths): absolute paths support
Opened this issue · 0 comments
@phbernard, ping.
1. Summary
If iconsPath
is absolute path to site root:
it would be nice if RealFaviconGenerator will not inject into HTML these lines:
<link rel="shortcut icon" href="https://kristinita.netlify.app/favicon.ico">
<meta name="msapplication-config" content="https://kristinita.netlify.app/browserconfig.xml">
2. Argumentation
Developers may prefer absolute links to relative. I always use absolute paths, so that other developers can use my sources without additional difficulties. As Philippe Bernard wrote on Stack Overflow relative and absolute paths both work.
But if the value of iconsPath
key is absolute path, not /
, RealFaviconGenerator inject to HTML files 2 additional lines. In the same time RealFaviconGenerator FAQ says that favicon.ico
shouldn’t be declared in HTML, but if I use absolute path as value of iconsPath
key, it declared.
3. Data
This is the configuration for Grunt, but my issue is relevant for another RealFaviconGenerator implementations as well.
4. Behavior
4.1. Absolute paths
Part of my realFavicon.coffee
:
iconsPath: "https://kristinita.netlify.app"
or, for example, it may be:
iconsPath: "<%= templates.yamlconfig.SITEURL %>"
Where <%= templates.yamlconfig.SITEURL %>
is Grunt template for absolute path to head page my site.
RealFaviconGenerator inject to HTML:
<link rel="apple-touch-icon" sizes="180x180" href="https://kristinita.netlify.app/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://kristinita.netlify.app/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://kristinita.netlify.app/favicon-16x16.png">
<link rel="manifest" href="https://kristinita.netlify.app/site.webmanifest">
<link rel="mask-icon" href="https://kristinita.netlify.app/safari-pinned-tab.svg" color="darkorange">
<link rel="shortcut icon" href="https://kristinita.netlify.app/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Kristinita’s Search">
<meta name="application-name" content="Kristinita’s Search">
<meta name="msapplication-TileColor" content="darkorange">
<meta name="msapplication-TileImage" content="https://kristinita.netlify.app/mstile-144x144.png">
<meta name="msapplication-config" content="https://kristinita.netlify.app/browserconfig.xml">
<meta name="theme-color" content="#ffffff"></head>
2 unexpected lines:
<link rel="apple-touch-icon" sizes="180x180" href="https://kristinita.netlify.app/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://kristinita.netlify.app/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://kristinita.netlify.app/favicon-16x16.png">
- <link rel="manifest" href="https://kristinita.netlify.app/site.webmanifest">
<link rel="mask-icon" href="https://kristinita.netlify.app/safari-pinned-tab.svg" color="darkorange">
<link rel="shortcut icon" href="https://kristinita.netlify.app/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Kristinita’s Search">
<meta name="application-name" content="Kristinita’s Search">
<meta name="msapplication-TileColor" content="darkorange">
<meta name="msapplication-TileImage" content="https://kristinita.netlify.app/mstile-144x144.png">
- <meta name="msapplication-config" content="https://kristinita.netlify.app/browserconfig.xml">
<meta name="theme-color" content="#ffffff"></head>
4.2. Relative paths
If:
- iconsPath: "https://kristinita.netlify.app"
+ iconsPath: "/"
RealFaviconGenerator inject relative paths without shortcut icon
and msapplication-config
.
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="darkorange">
<meta name="apple-mobile-web-app-title" content="Kristinita’s Search">
<meta name="application-name" content="Kristinita’s Search">
<meta name="msapplication-TileColor" content="darkorange">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
4.3. Desired
Absolute paths without shortcut icon
and msapplication-config
.
<link rel="apple-touch-icon" sizes="180x180" href="https://kristinita.netlify.app/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://kristinita.netlify.app/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="https://kristinita.netlify.app/favicon-16x16.png">
<link rel="manifest" href="https://kristinita.netlify.app/site.webmanifest">
<link rel="mask-icon" href="https://kristinita.netlify.app/safari-pinned-tab.svg" color="darkorange">
<meta name="apple-mobile-web-app-title" content="Kristinita’s Search">
<meta name="application-name" content="Kristinita’s Search">
<meta name="msapplication-TileColor" content="darkorange">
<meta name="msapplication-TileImage" content="https://kristinita.netlify.app/mstile-144x144.png">
<meta name="theme-color" content="#ffffff"></head>
5. Possible solution
For example, key root
.
If:
root: true
RealFaviconGenerator will not inject msapplication-config
and shortcut icon
links to HTML files whatever the value of the iconsPath
key.
Thanks.