gulp-base64-favicon
v1.0.3
Published
Convert image file to base64 format and use it as favicon
Downloads
221
Maintainers
Readme
gulp-base64-favicon
Install
With npm do:
npm install gulp-base64-favicon --save-dev
Example
<head>
<meta charset="utf-8">
<!-- shortcut::favicon.png -->
<link rel="stylesheet" href="style.css">
...
</head>
var gulp = require('gulp');
var favicon = require('gulp-base64-favicon');
gulp.task('default', function() {
return gulp.src('./index.html')
.pipe(favicon())
.pipe(gulp.dest('./out'));
});
In the output directory you will find your index.html with the following content:
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUh...sAAAAAElFTkSuQmCC"/>
<link rel="stylesheet" href="style.css">
...
</head>
API
favicon(src)
src
Type: String
Path to the source directory.
favicon(obj)
obj
Type: Object
Container for data.
obj.src
Type: String
Path to the source directory.
License
MIT © Makarian Vladyslav