From 639d00d8df45a3362dd52628aeb1411b46a92d62 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Tue, 31 May 2016 08:34:29 -0400 Subject: [PATCH] Revert "Removing separate SVG CSS rendering" This reverts commit e9a0def7d86a8cd18faaa26186e3ad870d6921ab. --- gulpfile.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index affbc88..56a069e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -64,13 +64,16 @@ gulp.task('static', 'Build static files into ./build directory.', function() { .pipe(gulp.dest(config.buildRoot)); }); -gulp.task('markup', 'Build markup into ./build directory.', function() { +gulp.task('markup', 'Build markup into ./build directory.', ['markup:svg_styles'], function() { return gulp.src(config.globs.templates) .pipe(frontMatter()) .pipe(hb({ data: config.globs.data, helpers: config.globs.helpers, - partials: config.globs.partials, + partials: _.flatten([ + config.globs.partials, + './tmp/build/svg_styles.hbs' + ]), parsePartialName: function(option, file) { return _.last(file.path.split(/\\|\//)).replace('.hbs', ''); }, @@ -81,6 +84,21 @@ gulp.task('markup', 'Build markup into ./build directory.', function() { .pipe(gulp.dest(config.buildRoot)); }); +gulp.task('markup:svg_styles', false, function() { + return gulp.src('./src/sass/svg.scss') + .pipe(sass({ + includePaths: bourbon.includePaths, + outputStyle: 'compressed' + })) + .on('error', notify.onError()) + .pipe(rename({ + dirname: '', + basename: 'svg_styles', + extname: '.hbs' + })) + .pipe(gulp.dest('./tmp/build')) +}); + gulp.task('styles', 'Build stylesheets into ./build directory.', function() { return gulp.src('./src/sass/main.scss', { base: '.' }) .pipe(sourcemaps.init())