vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Additional Tasks information

codyellingham opened this issue · comments

In the FAQ:

screen shot 2018-09-22 at 13 02 33

The "Additional Tasks" link does not work, where can I find more information how to use this please?
I would like to add Sitemap task. (https://yarnpkg.com/en/package/sitemap#example-of-pre-generating-sitemap-based-on-existing-static-files)

@yannou788 Thank you, how would you add a task for a new task, such as a sitemap maker? This is what I have, it runs the task but nothing is generated.

  additionalTasks: {
    initialize(gulp, PATH_CONFIG, TASK_CONFIG) {

      gulp.task('sitemap', function () {
          gulp.src('./public/**/*.html', {
                  read: false
              })
              .pipe(sitemap({
                  siteUrl: 'http://example.com'
              }))
              .pipe(gulp.dest('./public'));
      });
    },
     development: {
      prebuild: null,
      postbuild: ['sitemap'],
    },
    production: {
      prebuild: null,
      postbuild: null,
    }
  }

@cbje-tokyo Hi, maybe it's your src path that's not good sometime it's happen, and try this :

    initialize(gulp, PATH_CONFIG, TASK_CONFIG) {

      gulp.task('sitemap', function () {
          gulp.src('./public/**/*.html', {
                  read: false
              })
              .pipe(sitemap({
                  siteUrl: 'http://example.com'
              }))
              .pipe(gulp.dest('./public'));
      });
    },
    production: {
      postbuild: ['sitemap']
    }
  }

I would add that you can accesses values set in task-config.js and path-config.json with TASK_CONFIG.<option> and PATH_CONFIG.<option>.

@cbje-tokyo did you solve this?