Panini基础json问题

时间:2019-06-15 22:48:18

标签: json zurb-foundation

在我的基础src下,我有一个数据,创建了新的json文件。当我用{{file}}对其进行标记时,它不会显示在索引中。 html,当我执行npm run start时。

我做到了,数据:src / data添加了gulp手表 没有结果。

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",
      data: "src/data"
    }))
    .pipe(inky())
    .pipe(gulp.dest('dist'));

function watch() {
  gulp.watch('src/pages/**/*.html').on('all', gulp.series(pages, inline, browser.reload));
  gulp.watch(['src/layouts/**/*', 'src/partials/**/*']).on('all', gulp.series(resetPages, pages, inline, browser.reload));
  gulp.watch(['../scss/**/*.scss', 'src/assets/scss/**/*.scss']).on('all', gulp.series(resetPages, sass, pages, inline, browser.reload));
  gulp.watch('src/assets/img/**/*').on('all', gulp.series(images, browser.reload));
  gulp.watch('src/data/**/*.{js,json,yml}').on('all', gulp.series(resetPages, pages, browser.reload));
  gulp.watch(['../scss/**/*.scss', 'src/assets/scss/**/*.scss', 'src/data/*']).on('all', gulp.series(resetPages, sass, pages, inline, browser.reload));
  gulp.watch('src/data/**/*.json').on('change', gulp.series(resetPages, pages, inline, browser.reload));

}

1 个答案:

答案 0 :(得分:0)

只是一个猜测,但行尾有斜线。

function pages() {
  return gulp.src('src/pages/**/*.{html,hbs,handlebars,php}')
    .pipe(panini({
      root: 'src/pages/',
      layouts: 'src/layouts/',
      partials: 'src/partials/',
      data: 'src/data/',
      helpers: 'src/helpers/'

    }))
    .pipe(gulp.dest(PATHS.dist));
}