Willow

As willowy as a young Doris Day

  • By Patrick Ward
  • Website can be found at GitHub

Willow is a slender system for generating static websites. Like similar static site generators (Jekyll, nanoc), it takes a collection of templates, posts, and pages that are written in Markdown, Handlebars, or Haml and produces a static (or semi-static) website that can be used on any web server.

Willow does not try to be everything to everyone, but it does try to be accomodating. It's opinionated in which text filters it uses, but it does provide some level of configuration.

It was originally created as a way for me to get back into Ruby development after a few years away from the language. So, I'm sure there is a lot of optimization that can be added to the source.

Installation

  sudo gem install willow

Dependencies

Configuration

Willow provides a number of configuration options that let you change how your site is generated. Most of these should be placed in a _config.yml file at the root of your site's source directory.

See the defaults section below, for examples of how the configuration file should be crafted.

Configuration Settings

  • paths:, This section sets the relative paths that _willow uses to look for source pages, posts, and layouts.

    • pages: [string path], relative path to the static pages directory
    • posts: [string path], relative path to the dated posts directory
    • layouts: [string path], relative path to the templated layouts directory
  • defaults:, This section provides defaults that can be used across all posts and pages. _Willow looks for the configuration options below, but you may also add your own default values as well. Anything that looks like a path and has an extension (e.g. haml, mustache, markdown, or md) is first converted and the resulting string value is returned. All other values are returned as is.

    • layout: [string], name of the default layout template in the layouts directory
    • extension: [string], the default file extension to use when generating files
    • site_name: [string], the site's title
  • redcarpet:, this section allows you to change how the redcarpet gem is used. See that gem for details on the extensions options.

    • extensions:
    • non_intra_emphasis: [boolean]
    • tables: [boolean]
    • fenced_code_blocks: [boolean]
    • autolink: [boolean]
    • strikethrough: [boolean]
    • lax_html_blocks: [boolean]
    • space_after_headers: [boolean]
    • superscript: [boolean]
    • renderer:
    • filter_html: [boolean]
    • no_images: [boolean]
    • no_links: [boolean]
    • no_styles: [boolean]
    • safe_links_only: [boolean]
    • with_toc_data: [boolean]
    • hard_wrap: [boolean]
    • xhtml: [boolean]

Default Configuration

  paths:
    :pages: _pages
    :posts: _posts
    :layouts: _layouts
  defaults:
    :layout: "default.haml"
    :extension: html
    :site_name: "Another Beautiful Willow Site"
  redcarpet:
    extensions:
      :non_intra_emphasis: false
      :tables: false
      :fenced_code_blocks: false
      :autolink: false
      :strikethrough: false
      :lax_html_blocks: false
      :space_after_headers: false
      :superscript: false
    renderer:
      :filter_html: false
      :no_images: false
      :no_links: false
      :no_styles: false
      :safe_links_only: false
      :with_toc_data: false
      :hard_wrap: false
      :xhtml: false

Usage

Creating