Video Assets in Sage

How can I manage the videos in the sage theme?
I would like to create a folder just for these, similar to the images folder in the assets, so when I run gulp creates the videos folder also in the dist folder.

I created a folder videos in the assets folder, i added this code in the gulpfile.js, I run gulp videos but without success

// ### videos
gulp.task('videos', function() {
  return gulp.src(globs.videos)
    .pipe(gulp.dest(path.dist + 'videos'));
});

where I’m wrong? is this the correct workflow?

Related: https://github.com/austinpray/asset-builder/issues/35

/cc @austin

Also: Gulp tasks remove content from assets/ directory

Maybe @luqo33 can share his task?

So I did it like this, using https://github.com/cowboy/node-globule

My videos are located in assets/video.

var globule = require('globule');

gulp.task('video', function() {
  var videos = globule.find(path.source + "video/*");
  return gulp.src(videos)
      .pipe(gulp.dest(path.dist + 'video'))
      .pipe(browserSync.stream());
});

And then I added the task to the gulp build

gulp.task('build', function(callback) {
  runSequence('styles',
              'scripts',
              'video',
              ['fonts', 'images'],
              callback);
});

Hope that’s of some help.

2 Likes

thanks @roryatbrightoak :wink: