Skip to content

solarsailer/hugo-boilerplate

Repository files navigation

Hugo Boilerplate

Hugo is a static site generator built with Go.

This is a basic boilerplate to start creating a site with Hugo.

It includes a build pipeline with Webpack:

  • Sass files are converted to CSS and augmented with Autoprefixer.
  • JavaScript files are processed through Babel with the ES2015 preset.

Installation

  1. Install Hugo
  2. Install Yarn
  3. Install dependencies with yarn install

Usage

Development

The development pipeline uses Browser-Sync, Webpack and Hugo, through a simple Gulp task.

To start, just run:

yarn run start

A server will be started on localhost:8080.

Production

Ready to put in production? Just use:

yarn run build

And copy the files of the public folder on your server, by any means.

Known issues

  • Gulp is not necessary. A simple shell script could replace it easily, but we would lose the portability. For the moment, it's good enough.
  • The development pipeline is overly complicated, in my opinion, and not optimized (three watchers, no in-memory assets). A built-in Sass/ES6 pipeline integrated with Hugo would simplify this a lot. See "Rational" in gulpfile.js.