From e80a0c04dae31bbb06cdf7bfc905c92131a4b5f5 Mon Sep 17 00:00:00 2001 From: Pavlo B Date: Sun, 12 May 2019 20:59:52 -0700 Subject: [PATCH 1/2] Bump panini to support partials in subfolders --- gulpfile.babel.js | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index d3110ad..de4de54 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -2,7 +2,7 @@ import gulp from 'gulp'; import plugins from 'gulp-load-plugins'; import browser from 'browser-sync'; import rimraf from 'rimraf'; -import panini from 'panini'; +import panini from 'panini/gulp'; import yargs from 'yargs'; import lazypipe from 'lazypipe'; import inky from 'inky'; @@ -48,23 +48,23 @@ function clean(done) { rimraf('dist', done); } +// Panini istance to be shared between `pages()` and `resetPages()` to watch for new files +let _paniniInst = null; + // Compile layouts, pages, and partials into flat HTML files // Then parse using Inky templates function pages() { - return gulp.src(['src/pages/**/*.html', '!src/pages/archive/**/*.html']) - .pipe(panini({ - root: 'src/pages', - layouts: 'src/layouts', - partials: 'src/partials', - helpers: 'src/helpers' - })) + const stream = panini('src'); + _paniniInst = stream._panini; + + return stream .pipe(inky()) .pipe(gulp.dest('dist')); } // Reset Panini's cache of layouts and partials function resetPages(done) { - panini.refresh(); + _paniniInst && _paniniInst.refresh(); done(); } diff --git a/package.json b/package.json index 5dead98..9396703 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "inky": "^1.3.6", "lazypipe": "^1.0.1", "merge-stream": "^1.0.0", - "panini": "^1.3.0", + "panini": "https://github.com/zurb/panini.git#v2.0", "rimraf": "^2.3.3", "siphon-media-query": "^1.0.0", "yargs": "^4.1.0" From b3e9a83c5f9ca3f65f8cf4e1420949d87a0ca5b4 Mon Sep 17 00:00:00 2001 From: Pavlo B Date: Sun, 1 Dec 2019 14:48:07 -0800 Subject: [PATCH 2/2] Fix Panini version to use semver --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9396703..8e9c72b 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "inky": "^1.3.6", "lazypipe": "^1.0.1", "merge-stream": "^1.0.0", - "panini": "https://github.com/zurb/panini.git#v2.0", + "panini": "^2.0.0-alpha.2", "rimraf": "^2.3.3", "siphon-media-query": "^1.0.0", "yargs": "^4.1.0"