Skip to content

Jekyll generator plugin to enable a running total to be kept for front matter elements.

License

Notifications You must be signed in to change notification settings

nitehawk/jekyll-frontadder

Repository files navigation

Welcome to Jekyll Front Adder

Jekyll Front Adder is a module to add up the values of specified hashes from a post's front matter and add a running total back to the post's front matter.

Build Status GitHub version

Installation

Add this line to your site's Gemfile:

gem 'jekyll-frontadder'

And then add this line to your site's _config.yml:

gems:
  - jekyll-frontadder

Usage

Add an entry similar to the following to your _config.yml:

frontadder:
  - hours

This will configure frontadder to look for a hash structure called 'hours' on your site's posts, similar to the following:

hours:
  total: .5
  part:
    horizontal stabilizer: .5
  type:
    deburring: .5

When it finds this structure, it will add up all of the keys it finds. As each post is processed, a copy of the running totals will be left under ['hash']['runtotal'] for use on the page. After the plugin finishes, the site will have a hash entry with the totals for the entire site.

About

Jekyll generator plugin to enable a running total to be kept for front matter elements.

Resources

License

Stars

Watchers

Forks

Packages

No packages published