Michael Douglas Brett - Web Development

Hi, I'm Michael. I'm a front-end web developer based in the UK. This is my site.

The More Things Change, The More They Stay The Same

Gulp UNIX Programming

Jan 11th 2016

I recently rebuilt my site, having been shamed into it by this article (I was a textbook case). I took the opportunity to put together as many of the skills I had learnt up to this point.

Here is a list of the criteria for my rebuild:

I decided on building a static site, powered by Gulp. Gulp is a JavaScript build tool that uses streams of vinyl files, and pipes them through various transformations provided by plugins (or plain old JavaScript functions). It helps you do all the cool things like compile your Sass, concat and minify your assets, pull out your critical path css, etc etc. I use Gulp in my day-to-day front-end build process, so I was familiar with it, and what I was trying to do didn't seem to be that much of a stretch. I did a little googling and found it had been done before.

Here is a gulptask from this very site:

gulp.task('mdbPosts', function () {
  return gulp.src(CONFIG.content.posts)
    .pipe($.frontMatter({property: 'frontMatter', remove: true}))
    .pipe($.markdown())
    .pipe(SH.mdbDataObject())
    .pipe(SH.mdbSummarize())
    .pipe(SH.mdbDateFormatter())
    .pipe(SH.mdbCollectPosts())
    .pipe(TF.applyHeaderTemplate())
    .pipe(TF.applyPostBodyTemplate())
    .pipe(TF.applyFooterTemplate())
    .pipe(SH.mdbFileBuilder())
    .pipe(SH.mdbPathBuilder())
    .pipe(gulp.dest(CONFIG.dest));
});

It is a pretty straightforward process, one that really reminds me of the demo in this video (the more things change...).

Did I meet my goals?

Now all I have to do is resist the burning desire to fork it, and rewrite it in bash.