metalsmith-html-favicons
v0.0.4
Published
A Metalsmith plugin to generate favicons.
Maintainers
Readme
metalsmith-html-favicons
A Metalsmith plugin to generate favicons.
Installation
npm install --save metalsmith-html-faviconsJavaScript Usage
import Metalsmith from 'metalsmith';
import favicons from 'metalsmith-html-favicons';
Metalsmith(__dirname)
.use(favicons({
// options here
}))
.build((err) => {
if (err) {
throw err;
}
});Options
icon (required)
Type: string
Filename path or micromatch pattern to the source icon. The icon must have been included in the Metalsmith build.
destination (optional)
Type: string Default: (write to the root directory)
Output directory to write generated icon and manifest files to.
html (optional)
Type: string Default: "**/*.html"
A micromatch glob pattern to find HTML files.
favicons (optional)
Type: object Default (don't generate any manifest files, only favicons):
{
"icons": {
"android": false,
"appleIcon": false,
"appleStartup": false,
"favicons": true,
"windows": false,
"yandex": false
}
}An object of favicons options.
Example Output
Given the default favicons options which don't generate any manifest files, the following files will be created:
.
├── favicon-16x16.png
├── favicon-32x32.png
├── favicon-48x48.png
└── favicon.icoand this will be added to the <head> of every HTML page:
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="48x48" href="/favicon-48x48.png">