Grain Framework

Grain is a lightweight, yet powerful, static website generator for Groovy that makes demanding static site implementation intuitive and enjoyable.

Find out more

Live preview

Live preview to make and see changes on the fly. Grain instantly reloads any changes made to site content and saves time on implementing styles and layouts.

Embedded code processing

Grain allows you to pass custom preferences to site pages and perform dynamic modification of resources by executing embedded Groovy code inside content files and templates.

Resource URL mapping

Resource to URL mapping minimizes the number of templates by allowing you to associate the same page file with different urls, content and preferences.

Templates and in-page tags

Infinite template nesting and tag libraries make Grain suitable for large-sized projects. Built-in tags designed for combining page parts help keep templates DRY and easy to read.

Variety of supported markups

Grain supports Markdown, RST and AsciiDoc markups. TxtMark or PegDown is used for rendering Markdown, Python Docutils for RST, and Ruby Asciidoctor for AsciiDoc.

Gradle plugin

Thanks to the Gradle plugin, it is easy to integrate any Grain theme with a Gradle project and build a project website with up-to-date documentation and source samples.

Ready to launch

Grain comes with themes and examples for an easy start. The framework has been around for a while now, and has a sufficient number of site templates to play and learn with.

Grain Framework

Been using Grain for less than a week and it’s been an awesomely pleasurable experience. It fits perfectly with our build chain which was already based around gradle. Most noticeable is the time to generate the site is about a tenth of what we had with our previous static site generator. Bonus, you can make changes to groovy code in your theme without restarting the preview. Being able to add deployment tasks in groovy has been great too - now the CI build deploys sites directly to nexus where they are browseable. Even minor things such as the ability to run the preview directly from IDEA has made my life much easier. So, thanks for Grain.

Jamie Echlin