XUtils

Grain

Static Web Site Building Framework For Groovy


Banner

Twitter Follow Twitter Follow

Grain is a lightweight framework and a very powerful static website generator written in Groovy to help make website creation intuitive and enjoyable. Grain suits development of complex, static websites for companies and neat blogging websites for personal use. The framework builds on simple ideas and provides live reload to help you rapidly develop custom themes.

Documentation

All the Grain documentation is located in teh [docs/General Docs.md] file. You may learn more about using Grain in the following sections:

  • [IDE Integration]
  • [Grain website structure]
  • [Environments]
  • [Advanced Grain configuration]
  • [Page structure]
  • [Layouts]
  • [Includes]
  • [URL and resource mapping]
  • [Tag libraries]

Themes & templates

A Grain website project is called a theme, and Grain has a few developed responsive themes that you can use. Consult the list of pre-built Grain themes below:

  • [Agency]
  • [Business Casual]
  • [Clean Blog]
  • [Freelancer]
  • [Grain Stylish Portfolio]
  • [Grain Theme Template]
  • [New Age]
  • [Octopress]

Getting started

Requirements

To run a Grain project, you need to use [JDK 7 or later]. Download and install the appropriate JDK for your operating system.

Preview a Grain website

Navigate to the location of your newly created website and run the command below to launch the project in preview mode:

cd /path/to/your_site
./grainw

Here and further the command-line snippets are provided only for the Unix-like operation systems. If you’re running Grain on Windows, use the grainw command instead of ./grainw.

Once the project is built, you can visit your favorite browser at http://localhost:4000 to view the website. You can add, change, or delete website files and see all the changes in the browser immediately after refreshing the page.

Generate and deploy

When you’re ready to deploy your Grain-based website, you first need to generate all the website files by executing the following command:

./grainw generate

The website files are generated into the /path/to/your_site/target directory.

You can deploy the website files either manually or with the help of Grain:

./grainw deploy

Check the [Deployment Configuration] section for more information.

The Grain Community

There are many ways to get involved with the project:

  • [Mailing List] - reach us or ask the community for help
  • [Issue Tracker] - make Grain better by suggesting improvements
  • [Twitter] - keep up with the latest Grain news and announcements

Articles

  • coming soon...