Ginger is a utility for quickly generating data-driven static sites.
To get started, just
$ cd some-project-directory
$ ginger new
This will create the barebones project template, which consists of:
_data
- where you store any local data files_drafts
- where you keep any views you don't want in the final site_includes
- where jinja2 partials live_layouts
- where jinja2 site layouts live_scss
- check out ginger's super minimal scss_views
- this is where your view files will go_css
- this is where the outputted css will gojs
- where scripts live_config.yaml
- set site title, layout style, etc. here
Ginger includes several examples to give you a feel for how things work. Edit these or nuke them and start from scratch.
Note - As a handy utility, we've included Swag by default. Swag is a collection of super useful template helpers to use in constructing views. Yeeeahhh!
For ginger to work properly, each view has to start with 'front matter'. If you've used Jekyll you already know how it goes. Basically, each view needs to start with a section like:
---
title: Top 20 Current NYTimes Best Sellers
id: best-sellers
description: The hardcover fiction list from the New York Times.
data_source: "/_data/nytimes_best_sellers.json"
---
All of the fields are required.
Once you've finished editing the view, run ginger build
to generate your new site! Whoa! Or run ginger serve
to build it and serve it locally! Even cooler! If you're using local data sources (ie, files stored in the _data
directory) you will probably need to use ginger serve
to preven cross-site-origin-policy errors in your browser.
To install Ginger, simply clone (or download the .zip) into a local directory
and run python setup.py install
. Voila!
Ginger was inspired by Github Jekyll and built by Scott Ogle and Nate Prewitt, using:
- Cliff
- Jinja2
- Handlebars
- Swag
- Bootstrap
- jQuery
- Lodash
- PyYAML
- and Bootstrap