diff --git a/Gruntfile.js b/Gruntfile.js index cc3d36dc6c..d3ae934af1 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -254,21 +254,6 @@ var config = require('./core/server/config'), } }, - // ### grunt-docker - // Generate documentation from code - docker: { - docs: { - dest: 'docs', - src: ['.'], - options: { - onlyUpdated: true, - exclude: 'node_modules,bower_components,content,core/client,*test,*doc*,' + - '*vendor,config.*.json,*buil*,.dist*,.idea,.git*,.travis.yml,.bower*,.editorconfig,.js*,*.md,' + - 'MigratorConfig.js' - } - } - }, - // ### grunt-contrib-clean // Clean up files as part of other tasks clean: { diff --git a/content/themes/casper/gulpfile.js b/content/themes/casper/gulpfile.js index 831e70f613..779a588566 100644 --- a/content/themes/casper/gulpfile.js +++ b/content/themes/casper/gulpfile.js @@ -1,13 +1,14 @@ var gulp = require('gulp'); +var pump = require('pump'); // gulp plugins and utils -var gutil = require('gulp-util'); var livereload = require('gulp-livereload'); var postcss = require('gulp-postcss'); var sourcemaps = require('gulp-sourcemaps'); var zip = require('gulp-zip'); var uglify = require('gulp-uglify'); var filter = require('gulp-filter'); +var beeper = require('beeper'); // postcss plugins var autoprefixer = require('autoprefixer'); @@ -16,23 +17,26 @@ var cssnano = require('cssnano'); var customProperties = require('postcss-custom-properties'); var easyimport = require('postcss-easy-import'); -var swallowError = function swallowError(error) { - gutil.log(error.toString()); - gutil.beep(); - this.emit('end'); -}; - var nodemonServerInit = function () { livereload.listen(1234); }; +function handleError(done) { + return function (err) { + if (err) { + beeper(); + } + return done(err); + }; +} + gulp.task('build', ['css', 'js'], function (/* cb */) { return nodemonServerInit(); }); gulp.task('generate', ['css', 'js']); -gulp.task('css', function () { +gulp.task('css', function (done) { var processors = [ easyimport, customProperties, @@ -41,45 +45,49 @@ gulp.task('css', function () { cssnano() ]; - return gulp.src('assets/css/*.css') - .on('error', swallowError) - .pipe(sourcemaps.init()) - .pipe(postcss(processors)) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest('assets/built/')) - .pipe(livereload()); + pump([ + gulp.src('assets/css/*.css'), + sourcemaps.init(), + postcss(processors), + sourcemaps.write('.'), + gulp.dest('assets/built/'), + livereload() + ], handleError(done)); }); -gulp.task('js', function () { +gulp.task('js', function (done) { var jsFilter = filter(['**/*.js'], {restore: true}); - return gulp.src('assets/js/*.js') - .on('error', swallowError) - .pipe(sourcemaps.init()) - .pipe(jsFilter) - .pipe(uglify()) - .pipe(jsFilter.restore) - .pipe(sourcemaps.write('.')) - .pipe(gulp.dest('assets/built/')) - .pipe(livereload()); + pump([ + gulp.src('assets/js/*.js'), + sourcemaps.init(), + jsFilter, + uglify(), + jsFilter.restore, + sourcemaps.write('.'), + gulp.dest('assets/built/'), + livereload() + ], handleError(done)); }); gulp.task('watch', function () { gulp.watch('assets/css/**', ['css']); }); -gulp.task('zip', ['css', 'js'], function () { +gulp.task('zip', ['css', 'js'], function (done) { var targetDir = 'dist/'; var themeName = require('./package.json').name; var filename = themeName + '.zip'; - return gulp.src([ - '**', - '!node_modules', '!node_modules/**', - '!dist', '!dist/**' - ]) - .pipe(zip(filename)) - .pipe(gulp.dest(targetDir)); + pump([ + gulp.src([ + '**', + '!node_modules', '!node_modules/**', + '!dist', '!dist/**' + ]), + zip(filename), + gulp.dest(targetDir) + ], handleError(done)); }); gulp.task('default', ['build'], function () { diff --git a/content/themes/casper/index.hbs b/content/themes/casper/index.hbs index fb0bdbb230..1b27417d00 100644 --- a/content/themes/casper/index.hbs +++ b/content/themes/casper/index.hbs @@ -7,7 +7,7 @@ into the {body} of the default.hbs template --}}

{{#if @site.logo}} - + {{else}} {{@site.title}} {{/if}} diff --git a/content/themes/casper/package.json b/content/themes/casper/package.json index e53cf1c272..fbee5b55ef 100644 --- a/content/themes/casper/package.json +++ b/content/themes/casper/package.json @@ -2,7 +2,7 @@ "name": "casper", "description": "The default personal blogging theme for Ghost. Beautiful, minimal and responsive.", "demo": "https://demo.ghost.io", - "version": "2.9.0", + "version": "2.9.1", "engines": { "ghost": ">=2.0.0", "ghost-api": "v2" @@ -42,20 +42,21 @@ "contributors": "https://github.com/TryGhost/Casper/graphs/contributors", "devDependencies": { "autoprefixer": "6.3.6", + "beeper": "^1.1.1", "cssnano": "3.7.1", "gscan": "^2.0.0", "gulp": "3.9.1", + "gulp-filter": "5.1.0", "gulp-livereload": "3.8.1", "gulp-postcss": "6.1.1", "gulp-sourcemaps": "1.6.0", - "gulp-util": "3.0.7", + "gulp-uglify": "3.0.1", "gulp-watch": "4.3.8", "gulp-zip": "4.0.0", "postcss-color-function": "2.0.1", "postcss-custom-properties": "5.0.1", "postcss-easy-import": "1.0.1", - "gulp-filter": "5.1.0", - "gulp-uglify": "3.0.1" + "pump": "3.0.0" }, "config": { "posts_per_page": 25, diff --git a/content/themes/casper/partials/header.hbs b/content/themes/casper/partials/header.hbs index 6a83b89f72..4715cdd9af 100644 --- a/content/themes/casper/partials/header.hbs +++ b/content/themes/casper/partials/header.hbs @@ -18,28 +18,30 @@ with a `no-image` class so we can style it accordingly. background-image: url({{img_url background size='xl'}}); } @media(max-width: 1000px) { -.responsive-header-img { - background-image: url({{img_url background size='l'}}); - background-image: -webkit-image-set( - url({{img_url background size='l'}}) 1x, - url({{img_url background size='xl'}}) 2x - ); - background-image: image-set( - url({{img_url background size='l'}}) 1x, - url({{img_url background size='xl'}}) 2x - ); + .responsive-header-img { + background-image: url({{img_url background size='l'}}); + background-image: -webkit-image-set( + url({{img_url background size='l'}}) 1x, + url({{img_url background size='xl'}}) 2x + ); + background-image: image-set( + url({{img_url background size='l'}}) 1x, + url({{img_url background size='xl'}}) 2x + ); + } } @media(max-width: 600px) { -.responsive-header-img { - background-image: url({{img_url background size='m'}}); - background-image: -webkit-image-set( - url({{img_url background size='m'}}) 1x, - url({{img_url background size='l'}}) 2x - ); - background-image: image-set( - url({{img_url background size='m'}}) 1x, - url({{img_url background size='l'}}) 2x - ); + .responsive-header-img { + background-image: url({{img_url background size='m'}}); + background-image: -webkit-image-set( + url({{img_url background size='m'}}) 1x, + url({{img_url background size='l'}}) 2x + ); + background-image: image-set( + url({{img_url background size='m'}}) 1x, + url({{img_url background size='l'}}) 2x + ); + } }