]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Replace gulp-cached with gulp-newer to prevent Gulp crashes when changing the docs...
authorGeoff Kimball <geoff@zurb.com>
Fri, 11 Dec 2015 19:27:13 +0000 (11:27 -0800)
committerGeoff Kimball <geoff@zurb.com>
Fri, 11 Dec 2015 19:27:35 +0000 (11:27 -0800)
gulp/docs.js
gulpfile.js
package.json

index c6f885c0ca261b463deedd82b8e1ce17dd3d5367..4664b67db8427c79f3e8b37222301839b685d8a5 100644 (file)
@@ -1,9 +1,9 @@
 var gulp = require('gulp');
 var cacheBust = require('gulp-cache-bust');
-var cached = require('gulp-cached');
 var supercollider = require('supercollider');
 var buildSearch = require('../lib/buildSearch');
 var panini = require('panini');
+var newer = require('gulp-newer');
 
 supercollider
   .config({
@@ -18,7 +18,10 @@ supercollider
 // Assembles the layout, pages, and partials in the docs folder
 gulp.task('docs', function() {
   return gulp.src('docs/pages/**/*')
-    .pipe(cached('docs'))
+    .pipe(newer({
+      dest: '_build',
+      ext: '.html'
+    }))
     .pipe(supercollider.init())
     .pipe(panini({
       root: 'docs/pages/',
@@ -29,9 +32,18 @@ gulp.task('docs', function() {
     .pipe(gulp.dest('_build'));
 });
 
-gulp.task('docs:reset', function() {
-  delete cached.caches['docs'];
-  gulp.run('docs');
+gulp.task('docs:all', function() {
+  panini.refresh();
+
+  return gulp.src('docs/pages/**/*')
+    .pipe(supercollider.init())
+    .pipe(panini({
+      root: 'docs/pages/',
+      layouts: 'docs/layout/',
+      partials: 'docs/partials/'
+    }))
+    .pipe(cacheBust())
+    .pipe(gulp.dest('_build'));
 });
 
 gulp.task('docs:search', ['docs'], function(cb) {
index 5f8e25a59896a4f1e16d319b3b5587d12bd6a004..e9dc09631d434bdd095b51ae18f7193799992cf3 100644 (file)
@@ -6,7 +6,7 @@ var port = process.env.SERVER_PORT || 3000;
 requireDir('./gulp');
 
 // Builds the documentation and framework files
-gulp.task('build', ['clean', 'copy', 'docs', 'docs:search', 'sass', 'javascript']);
+gulp.task('build', ['clean', 'copy', 'docs:all', 'docs:search', 'sass', 'javascript']);
 
 // Starts a BrowerSync instance
 gulp.task('serve', ['build'], function(){
@@ -16,7 +16,7 @@ gulp.task('serve', ['build'], function(){
 // Runs all of the above tasks and then waits for files to change
 gulp.task('default', ['serve'], function() {
   gulp.watch('docs/**/*', ['docs', browser.reload]);
-  gulp.watch('docs/layout/*.html', ['docs:reset', browser.reload]);
+  gulp.watch(['docs/layout/*.html', 'docs/partials/*.html'], ['docs:all', browser.reload]);
   gulp.watch('scss/**/*', ['sass', browser.reload]);
   gulp.watch('docs/assets/scss/**/*', ['sass:docs', browser.reload]);
   gulp.watch('js/**/*', ['javascript:foundation', browser.reload]);
index 93620a926e02d5588cac0b2f5eca821e151fc72a..6d74f0fc8559b1c323dbdf9fd276a11d545ccaf1 100644 (file)
     "gulp": "^3.8.10",
     "gulp-autoprefixer": "^2.3.1",
     "gulp-cache-bust": "^1.0.2",
-    "gulp-cached": "^1.0.4",
     "gulp-concat": "^2.4.3",
     "gulp-filter": "^2.0.2",
     "gulp-jshint": "^1.9.2",
     "gulp-load-plugins": "^0.8.0",
     "gulp-minify-css": "^1.2.1",
+    "gulp-newer": "^1.1.0",
     "gulp-plumber": "^1.0.1",
     "gulp-prompt": "^0.1.2",
     "gulp-rename": "^1.2.2",
@@ -49,7 +49,7 @@
     "octophant": "^1.0.0",
     "open": "0.0.5",
     "opener": "^1.4.1",
-    "panini": "^1.0.0",
+    "panini": "^1.1.0",
     "parker": "0.0.9",
     "pretty-print": "^1.0.0",
     "prettyjson": "^1.1.3",