[TASK] inject favicon into html

This commit is contained in:
Christian Seyfferth 2020-05-07 20:58:36 +02:00
parent 84db669698
commit eaf8a67104
4 changed files with 127 additions and 4 deletions

View File

@ -9,6 +9,7 @@ const newer = require('gulp-newer');
const imagemin = require('gulp-imagemin');
const htmlclean = require('gulp-htmlclean');
const imageResize = require('gulp-image-resize');
const inject = require('gulp-inject');
const noop = require('gulp-noop');
const uglify = require('gulp-uglify-es').default;
const favicons = require('gulp-favicons');
@ -128,7 +129,13 @@ function pdf() {
}
function manifest() {
return src('dist/favicons/manifest.*')
return src(paths.html.dest + "index.html")
.pipe(inject(src(paths.html.dest + "favicons/index.html"), {
starttag: '<!-- inject:head:html -->',
transform: function (filePath, file) {
return file.contents.toString('utf8')
}
}))
.pipe(dest(paths.html.dest));
}
@ -145,17 +152,21 @@ function favicon() {
url: 'http://urlaub-friedrichroda.de/',
display: 'standalone',
orientation: 'portrait',
theme_color: "#bdf787",
lang: "de-DE",
scope: '/',
start_url: '/',
version: 1.0,
logging: false,
logging: true,
html: 'index.html',
pipeHTML: true,
replace: true,
}))
.pipe(dest(paths.html.dest + "favicons/"));
}
exports.images = parallel(images, imagesWebp);
exports.favicon = series(favicon, manifest);
exports.default = series(parallel(html, pdf, series(favicon, manifest)), js, series(scss, css), parallel(images, imagesWebp));
exports.serve = series(serve);

110
package-lock.json generated
View File

@ -586,6 +586,12 @@
"integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==",
"dev": true
},
"any-promise": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz",
"integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=",
"dev": true
},
"anymatch": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz",
@ -4749,6 +4755,56 @@
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
"dev": true
},
"group-array": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/group-array/-/group-array-1.0.0.tgz",
"integrity": "sha512-PJresALe5TUzSIcdWKLdAKcdUDxv8du2EGueShgAL2xknbcTo5Bk1xbNaNhxpWxxAx/SV7N+5S0UyK7XV0+QhA==",
"dev": true,
"requires": {
"arr-flatten": "^1.1.0",
"for-own": "^1.0.0",
"get-value": "^3.0.1",
"kind-of": "^6.0.2",
"split-string": "^6.1.0",
"union-value": "^2.0.1"
},
"dependencies": {
"get-value": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/get-value/-/get-value-3.0.1.tgz",
"integrity": "sha512-mKZj9JLQrwMBtj5wxi6MH8Z5eSKaERpAwjg43dPtlGI1ZVEgH/qC7T8/6R2OBSUA+zzHBZgICsVJaEIV2tKTDA==",
"dev": true,
"requires": {
"isobject": "^3.0.1"
}
},
"set-value": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/set-value/-/set-value-3.0.2.tgz",
"integrity": "sha512-npjkVoz+ank0zjlV9F47Fdbjfj/PfXyVhZvGALWsyIYU/qrMzpi6avjKW3/7KeSU2Df3I46BrN1xOI1+6vW0hA==",
"dev": true,
"requires": {
"is-plain-object": "^2.0.4"
}
},
"split-string": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/split-string/-/split-string-6.1.0.tgz",
"integrity": "sha512-9UBdnmnvx2NLLd4bMs7CEKK+wSzbujVv3ONyorkP1o8M3pVJQtXDO1cN19xD1JJs6ltOrtPrkUND0HzLSinUcA==",
"dev": true
},
"union-value": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-2.0.1.tgz",
"integrity": "sha512-NmcRHHhUy1qWmp6yYWsaURV2qwfS24TmTtO9S9x0L41wCNNVBQFD3toOzO0cd8SsNrFhbw/O0iYO5uffXGYocw==",
"dev": true,
"requires": {
"get-value": "^3.0.1",
"set-value": "^3.0.0"
}
}
}
},
"gulp": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz",
@ -4938,6 +4994,51 @@
"through2-concurrent": "^2.0.0"
}
},
"gulp-inject": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/gulp-inject/-/gulp-inject-5.0.5.tgz",
"integrity": "sha512-5bGMjqleXUHPu4CI1pnVzHtwyMy+Zt8EMo1RFwNsOpidPxwjFwyLgmsRZWGMMI8UenJMJRjURqwznfFmqb5wgw==",
"dev": true,
"requires": {
"ansi-colors": "^4.1.1",
"arrify": "^2.0.1",
"escape-string-regexp": "^2.0.0",
"fancy-log": "^1.3.3",
"group-array": "^1.0.0",
"plugin-error": "^1.0.1",
"stream-to-array": "^2.3.0",
"through2": "^3.0.1"
},
"dependencies": {
"ansi-colors": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
"integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
"dev": true
},
"arrify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
"integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",
"dev": true
},
"escape-string-regexp": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
"integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
"dev": true
},
"through2": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/through2/-/through2-3.0.1.tgz",
"integrity": "sha512-M96dvTalPT3YbYLaKaCuwu+j06D/8Jfib0o/PxbVt6Amhv3dUAtW6rTV1jPgJSBG83I/e04Y6xkVdVhSRhi0ww==",
"dev": true,
"requires": {
"readable-stream": "2 || 3"
}
}
}
},
"gulp-newer": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/gulp-newer/-/gulp-newer-1.4.0.tgz",
@ -9696,6 +9797,15 @@
"integrity": "sha1-hDBgmNhf25kLn6MAsbPM9V6O8B0=",
"dev": true
},
"stream-to-array": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/stream-to-array/-/stream-to-array-2.3.0.tgz",
"integrity": "sha1-u/azn19D7DC8cbq8s3VXrOzzQ1M=",
"dev": true,
"requires": {
"any-promise": "^1.1.0"
}
},
"stream-to-buffer": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/stream-to-buffer/-/stream-to-buffer-0.1.0.tgz",

View File

@ -13,6 +13,7 @@
"gulp-htmlclean": "^2.7.22",
"gulp-image-resize": "^0.13.1",
"gulp-imagemin": "^7.1.0",
"gulp-inject": "^5.0.5",
"gulp-newer": "^1.4.0",
"gulp-noop": "^1.0.0",
"gulp-rename": "^2.0.0",

View File

@ -6,8 +6,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Ferienwohnung "Wanderlust"</title>
<link rel="manifest" href="manifest.json">
<link rel="shortcut icon" href="/favicons/favicon.ico" type="image/x-icon">
<!-- inject:head:html -->
<!-- contents of html partials will be injected here -->
<!-- endinject -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<meta name="description" content="Unsere Ferienwohnung in Finsterbergen">
<meta name="keywords" content="Ferienwohnung, Unterkunft, Wandern, Friedrichroda, Kamin">