Skip to content

Local development environment

Jeff Fredrickson edited this page Feb 13, 2017 · 7 revisions

The CTO Website is a static site generated by Jekyll. It is designed to run on Federalist.

Prerequisites

On your local development system, you will need:

  • Ruby - the version included with your OS should be okay, but for development it's better to install your own Ruby version via a version manager such as rbenv

  • Node.js and npm - only if you need to manage vendor assets such as USWDS

Set up the local development environment

First, install Ruby gem dependencies:

bundle install

Then you can run the site locally with live reloading:

rake serve

You should now be able to preview the site on your local machine at http://localhost:4000/.

You can see what other rake tasks are available by running:

rake -T

Testing

There are two types of tests: ESLint and HTML Proofer. ESLint verifies JavaScript code quality, while HTML Proofer checks HTML validity, checks basic accessibility, and detects broken links.

To run all tests:

rake test