Add `updateglyphs` gulp command

Closes #296
This commit is contained in:
Christopher C. Wells 2021-09-03 20:33:25 -07:00
parent 690a270185
commit 5bcf10923c
5 changed files with 1278 additions and 81 deletions

View File

@ -278,6 +278,12 @@ Gulp also passes along non-overlapping arguments for this command, however
individual tests cannot be run with this command. `python manage.py test` can be
used for individual test execution.
#### `updateglyphs`
Downloads generated glyph font files data from [Fonttello](https://fontello.com/)
based on [`config.json` file](babybuddy/static_src/fontello/config.json). This
only needs to be run after making changes to the config file.
#### `updatestatic`
Rebuilds Baby Buddy's `/static` folder by running the following commands in

View File

@ -20,6 +20,10 @@ module.exports = {
files: 'babybuddy/static_src/root/*'
}
},
glyphFontCOnfig: {
configFile: 'babybuddy/static_src/fontello/config.json',
dest: 'babybuddy/static_src/fontello'
},
scriptsConfig: {
dest: basePath + 'js/',
vendor: [

View File

@ -4,6 +4,7 @@ var concat = require('gulp-concat');
var del = require('del');
var es = require('child_process').execSync;
var flatten = require('gulp-flatten');
var fontello = require('gulp-fontello');
var pump = require('pump');
var sass = require('gulp-sass')(require('sass'));
var sassGlob = require('gulp-sass-glob');
@ -225,6 +226,17 @@ function test(cb) {
});
}
/**
* Updates glyphs font data from Fontello.
*/
function updateglyphs(cb) {
pump([
gulp.src(config.glyphFontCOnfig.configFile),
fontello({ assetsOnly: false }),
gulp.dest(config.glyphFontCOnfig.dest)
], cb);
}
/**
* Watches for changes in configured files.
*/
@ -359,6 +371,8 @@ gulp.task('styles', styles);
gulp.task('test', test);
gulp.task('updateglyphs', updateglyphs);
gulp.task('watch', watch);
/**

1334
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,7 @@
"gulp-concat": "^2.6.1",
"gulp-csso": "^4.0.1",
"gulp-flatten": "^0.4.0",
"gulp-fontello": "^0.5.2",
"gulp-sass": "^5.0.0",
"gulp-sass-glob": "^1.1.0",
"gulp-spawn": "^1.0.0",