vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
MIT License
4.97k stars 680 forks source link

Additional Tasks information #564

Open codyellingham opened 6 years ago

codyellingham commented 6 years ago

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 commented 6 years ago

This is the good url https://github.com/vigetlabs/blendid/wiki/Configuration#alternatetask

codyellingham commented 6 years ago

@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,
    }
  }
yannou788 commented 6 years ago

@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']
    }
  }
olets commented 5 years ago

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?