Created
December 23, 2015 14:40
-
-
Save mitsuruog/eddfcb0081d63154f342 to your computer and use it in GitHub Desktop.
bootswatchからサムネイルを取得してリサイズするGulpタスク
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
const gulp = require('gulp'); | |
const imageResize = require('gulp-image-resize'); | |
const remoteSrc = require('gulp-remote-src'); | |
const bootstrapThemes = [ | |
'Cerulean', | |
'Cosmo', | |
'Cyborg', | |
'Darkly', | |
'Flatly', | |
'Journal', | |
'Lumen', | |
'Paper', | |
'Readable', | |
'Sandstone', | |
'Simplex', | |
'Slate', | |
'Spacelab', | |
'Superhero', | |
'United', | |
'Yeti' | |
].map((theme) => theme.toLowerCase()); | |
gulp.task('bootswatch', () => { | |
bootstrapThemes.map((theme) => { | |
remoteSrc(['thumbnail.png'], { | |
base: `https://bootswatch.com/${theme}/` | |
}) | |
.pipe(imageResize({ | |
width: 350 | |
})) | |
.pipe(rename(`${theme}.png`)) | |
.pipe(gulp.dest('thumbnails')) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment