Plugins You can find out about all the publicly available Grails plugins.

Haml plugin for Grails, based on JHaml

  • Tags: /
  • Latest: 0.3
  • Last Updated: 26 July 2010
  • Grails version: 1.2.2 > *
  • Authors: null
0 vote
compile "org.grails.plugins:haml:0.3"




First install the plugin:

grails install-plugin haml

Then add the following to your grails-app/config/spring/resources.groovy (in the beans block):

groovyPageResourceLoader(com.cadrlife.jhaml.grailsplugin.HamlGroovyPageResourceLoader) {
  baseResource = new".")

For Grails 2.0, use:

groovyPageResourceLoader(com.cadrlife.jhaml.grailsplugin.HamlGroovyPageResourceLoader) {
  baseResource = "file:."
  pluginSettings = new grails.util.PluginBuildSettings(grails.util.BuildSettingsHolder.settings)

You can now have ".haml" files in your views directory. They will be converted to GSPs on request (if using grails run-app) or on war creation.


Grails haml support, using JHaml. Allows you to automatically generate GSPs from .haml files.

/ Haml
    #date= date
    #address= user.address

<!-- GSP/JSP -->
<div id="profile">
  <div class="left column">
    <div id="date"><%= date %></div>
    <div id="address"><%= user.address %></div>
  <div class="right column">
    <div id="email"><%= %></div>
    <div id="bio"><%= %></div>

Learn more in the Haml tutorial.

Here are example translations of the default index.gsp and layout/main.gsp in newly created Grails projects.