Grain 0.7.0 Released

We are happy to announce a new stable Grain revision. First of all, we would like to give special thanks to everyone who helps make Grain better by leaving requests on Google Groups and reporting issues on GitHub. It would be much harder to move Grain forward without your support and contributions.

0.7.0 Release

Grain 0.7.0 is the major release which contains a lot of improvements, new features and bug fixes. This release is targeted at improving user experience and providing better compatibility with different development environments. We hope that this new version will help you create websites better and faster than ever before.


The most important dependencies were updated to the newer versions:

  • Groovy to 2.4.5
  • Jetty to 9.2.15
  • Compass to 1.0.3

Obsolete libraries like jsoup, signpost, etc. were removed from the build to speed up dependency download.

Also, the Java 7 NIO is now used to watch file changes in preview mode instead of jpathwatch library.

JDK 6 is no longer supported. Please, upgrade to the JDK 7 or newer version in order to use Grain 0.7.0.

Preview mode

We updated how index pages can be accessed in preview mode. Now Grain returns the same page, either browser points to the directory or to the index page, so and will return the same page.

Also, the broken pipe exception sometimes produced by Jetty on page load was suppressed (this is an ordinary behavior for Jetty which is aimed at preventing an application from generating content that cannot be sent).

Resource processing

The following improvements were made to the URL registry:

  • Implemented automatic changing of a file extension for .md, .adoc and .rst files to .html, so these files can be properly rendered by a browser after they were converted by Grain.

  • Enabled detection of the resources that are returned by the resource_mapper closure and have identical URLs, or do not have their url property defined. In both cases, Grain notifies the user that ResourceMapper returned an invalid list of resources.

Added defaults for processing the .swp and .woff2 file types:

  • .swp files (created by the Vi text editor) were added to the list of files excluded from processing. Excluded files are ignored by Grain when the site is generated.

  • .woff2 files were added to the list of binary files. Binary files are excluded from processing, but, contrary to the files from the excludes list, will be copied to the destination directory when the site is generated.

Ruby integration

The way on how Grain finds the right RubyGems version for native installation of Ruby has been changed. Now Grain tries to determine the gems version with the system 'gem' command and, only if this fails, refers to the predefined Ruby to RubyGems mapping which was also updated to account newer Ruby 2.1, 2.2 and 2.3 versions. Both these changes should significantly improve Grain compatibility with native Ruby installations.

Syntax highlighter

The default encoding for Pygments lexers was set to UTF-8 to ensure non-English symbols are displayed correctly. Error handling for the Pygments highlighting was improved as well — the stack trace now contains the code snippet that caused the error as well as the language specified for the snippet.

Other improvements and bugfixes

The template engine was modified to use iteration instead of recursion while generating Groovy script code in order to prevent stack overflows and the log file path that Grain was unable to parse if an exception occurs.

Also, fixed a rare, concurrency issue related to the resource header cache, when occasionally Grain failed to initialize the site preview mode due to unhandled concurrent access to the cache.

The full changelog is available in the Grain repository on GitHub.

If you are new to Grain, it is the perfect time to start, please feel free to download one of the themes and do not forget to leave us a feedback!

Looking for software developers? Don't hesitate to contact us.

Latest tweets