This is a gulp-based workflow to create email templates for the Sunlight Foundation and various products/tools. Stable, ready-to-use templates live in the dist
directory of the master branch. Raw templates and partials live in src
.
npm install
to install package dependencies. If npm isn't installed, follow these instructions to do so.npm install -g gulp
.gem install premailer
to install Premailer. (You'll need a compatible version of ruby installed for this. You might have to use sudo
also.)cp aws.json.example aws.json
gulp watch
. This will start a server and also watch for changes. The first time you run this task, it will create a build directory where local files will be served from.localhost:3000/template/{template.html}
where {template.html} is the filename of the template you want to work on.src
directory to your liking. (You should be working on a new branch for each individual template, so that master always maintains clean, stable versions of templates.)gulp build
, followed by gulp publish
. This will build and inline your source files, and output them to the dist
directory.If you have any relative paths to images, gulp publish
will replace them with an absolute URL for you. If you need to update the location of these paths, configure the variables in /gulp/tasks/publish.js.
To upload images to AWS:
gulp build
to optimize all source images.gulp uploadImg
to push them to AWS. This will override existing images. (Asset fingerprinting is a to-do.)