|
| 1 | +var gulp = require('gulp'); |
| 2 | +var realFavicon = require ('gulp-real-favicon'); |
| 3 | +var fs = require('fs'); |
| 4 | + |
| 5 | +// File where the favicon markups are stored |
| 6 | +var FAVICON_DATA_FILE = 'faviconData.json'; |
| 7 | + |
| 8 | +// Generate the icons. This task takes a few seconds to complete. |
| 9 | +// You should run it at least once to create the icons. Then, |
| 10 | +// you should run it whenever RealFaviconGenerator updates its |
| 11 | +// package (see the check-for-favicon-update task below). |
| 12 | +gulp.task('generate-favicon', function(done) { |
| 13 | + realFavicon.generateFavicon({ |
| 14 | + masterPicture: 'packet/static/assets/logo.svg', |
| 15 | + dest: 'packet/static', |
| 16 | + iconsPath: '/', |
| 17 | + design: { |
| 18 | + ios: { |
| 19 | + pictureAspect: 'backgroundAndMargin', |
| 20 | + backgroundColor: '#ffffff', |
| 21 | + margin: '35%', |
| 22 | + assets: { |
| 23 | + ios6AndPriorIcons: false, |
| 24 | + ios7AndLaterIcons: false, |
| 25 | + precomposedIcons: false, |
| 26 | + declareOnlyDefaultIcon: true |
| 27 | + } |
| 28 | + }, |
| 29 | + desktopBrowser: {}, |
| 30 | + windows: { |
| 31 | + pictureAspect: 'whiteSilhouette', |
| 32 | + backgroundColor: '#9f00a7', |
| 33 | + onConflict: 'override', |
| 34 | + assets: { |
| 35 | + windows80Ie10Tile: true, |
| 36 | + windows10Ie11EdgeTiles: { |
| 37 | + small: true, |
| 38 | + medium: true, |
| 39 | + big: true, |
| 40 | + rectangle: true |
| 41 | + } |
| 42 | + } |
| 43 | + }, |
| 44 | + androidChrome: { |
| 45 | + pictureAspect: 'noChange', |
| 46 | + themeColor: '#222222', |
| 47 | + manifest: { |
| 48 | + display: 'standalone', |
| 49 | + orientation: 'notSet', |
| 50 | + onConflict: 'override', |
| 51 | + declared: true |
| 52 | + }, |
| 53 | + assets: { |
| 54 | + legacyIcon: false, |
| 55 | + lowResolutionIcons: false |
| 56 | + } |
| 57 | + }, |
| 58 | + safariPinnedTab: { |
| 59 | + pictureAspect: 'silhouette', |
| 60 | + themeColor: '#222222' |
| 61 | + } |
| 62 | + }, |
| 63 | + settings: { |
| 64 | + scalingAlgorithm: 'Mitchell', |
| 65 | + errorOnImageTooSmall: false, |
| 66 | + readmeFile: false, |
| 67 | + htmlCodeFile: false, |
| 68 | + usePathAsIs: false |
| 69 | + }, |
| 70 | + markupFile: FAVICON_DATA_FILE |
| 71 | + }, function() { |
| 72 | + done(); |
| 73 | + }); |
| 74 | +}); |
0 commit comments