-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update link wiki and add gulp favicon
- Loading branch information
1 parent
8dd7449
commit 5e63b59
Showing
22 changed files
with
641 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
/** | ||
* Copyright 2016 OSBI Ltd | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// Necessary Plugins | ||
const gulp = require('gulp'); | ||
const plumber = require('gulp-plumber'); | ||
const realFavicon = require ('gulp-real-favicon'); | ||
const fs = require('fs'); | ||
const paths = require('../paths'); | ||
|
||
// Source: http://realfavicongenerator.net/ | ||
|
||
// File where the favicon markups are stored | ||
const FAVICON_DATA_FILE = `${paths.build.img}/faviconData.json`; | ||
|
||
// Generate the icons. This task takes a few seconds to complete. | ||
// You should run it at least once to create the icons. Then, | ||
// you should run it whenever RealFaviconGenerator updates its | ||
// package (see the check-for-favicon-update task below). | ||
gulp.task('generate-favicon', (done) => { | ||
realFavicon.generateFavicon({ | ||
masterPicture: paths.source.favicon, | ||
dest: paths.build.img, | ||
iconsPath: '/images/', | ||
design: { | ||
ios: { | ||
pictureAspect: 'backgroundAndMargin', | ||
backgroundColor: '#cc0000', | ||
margin: '14%', | ||
assets: { | ||
ios6AndPriorIcons: false, | ||
ios7AndLaterIcons: false, | ||
precomposedIcons: false, | ||
declareOnlyDefaultIcon: true | ||
} | ||
}, | ||
desktopBrowser: {}, | ||
windows: { | ||
pictureAspect: 'whiteSilhouette', | ||
backgroundColor: '#ae1817', | ||
onConflict: 'override', | ||
assets: { | ||
windows80Ie10Tile: false, | ||
windows10Ie11EdgeTiles: { | ||
small: false, | ||
medium: true, | ||
big: false, | ||
rectangle: false | ||
} | ||
} | ||
}, | ||
androidChrome: { | ||
pictureAspect: 'noChange', | ||
themeColor: '#ffffff', | ||
manifest: { | ||
name: 'Saiku Community', | ||
display: 'standalone', | ||
orientation: 'notSet', | ||
onConflict: 'override', | ||
declared: true | ||
}, | ||
assets: { | ||
legacyIcon: false, | ||
lowResolutionIcons: false | ||
} | ||
}, | ||
safariPinnedTab: { | ||
pictureAspect: 'silhouette', | ||
themeColor: '#ae1817' | ||
} | ||
}, | ||
settings: { | ||
scalingAlgorithm: 'Mitchell', | ||
errorOnImageTooSmall: false | ||
}, | ||
markupFile: FAVICON_DATA_FILE | ||
}, () => { | ||
done(); | ||
}); | ||
}); | ||
|
||
// Inject the favicon markups in your HTML pages. You should run | ||
// this task whenever you modify a page. You can keep this task | ||
// as is or refactor your existing HTML pipeline. | ||
gulp.task('inject-favicon-markups', ['generate-favicon'], () => { | ||
return gulp.src([`${paths.build.html}*.html`]) | ||
.pipe(realFavicon.injectFaviconMarkups( | ||
JSON.parse(fs.readFileSync(FAVICON_DATA_FILE)).favicon.html_code) | ||
) | ||
.pipe(gulp.dest(paths.build.html)); | ||
}); | ||
|
||
// Check for updates on RealFaviconGenerator (think: Apple has just | ||
// released a new Touch icon along with the latest version of iOS). | ||
// Run this task from time to time. Ideally, make it part of your | ||
// continuous integration system. | ||
gulp.task('check-for-favicon-update', (done) => { | ||
var currentVersion = JSON.parse(fs.readFileSync(FAVICON_DATA_FILE)).version; | ||
realFavicon.checkForUpdates(currentVersion, (err) => { | ||
if (err) { | ||
throw err; | ||
} | ||
}); | ||
}); | ||
|
||
// Call Favicon Install | ||
module.exports = gulp.task('favicon-install', | ||
['generate-favicon', 'inject-favicon-markups']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.