Skip to navigation Skip to main content

HAML

On this page
Eleventy Short Name File Extension npm Package
haml .haml hamljs
Eleventy or Plugin version hamljs version
@11ty/eleventy@0.x hamljs@0.6.x
@11ty/eleventy@1.x hamljs@0.6.x
@11ty/eleventy@2.x hamljs@0.6.x
@11ty/eleventy@3.x and newer N/A
@11ty/eleventy-plugin-haml@1.x hamljs@0.6.x

You can override a .haml file’s template engine. Read more at Changing a Template’s Rendering Engine.

Installation

Jump to section titled: Installation

The haml templating language was moved out of Eleventy core in v3 and now requires a plugin installation.

npm install @11ty/eleventy-plugin-haml

Add to your configuration file:

eleventy.config.js
import hamlPlugin from "@11ty/eleventy-plugin-haml";

export default function (eleventyConfig) {
	eleventyConfig.addPlugin(hamlPlugin);
}
const hamlPlugin = require("@11ty/eleventy-plugin-haml");

module.exports = function (eleventyConfig) {
	eleventyConfig.addPlugin(hamlPlugin);
}

Use more options:

eleventy.config.js
import haml from "hamljs";
import hamlPlugin from "@11ty/eleventy-plugin-haml";

export default function (eleventyConfig) {
	eleventyConfig.addPlugin(hamlPlugin, {
		// Override the `haml` library instance
		eleventyLibraryOverride: haml,
	});
}
const haml = require("hamljs");
const hamlPlugin = require("@11ty/eleventy-plugin-haml");

module.exports = function (eleventyConfig) {
	eleventyConfig.addPlugin(hamlPlugin, {
		// Override the `haml` library instance
		eleventyLibraryOverride: haml,
	});
}

Supported Features

Jump to section titled: Supported Features
Feature Syntax
🚫 Universal Filters Not yet supported :filterName some text Read more about Filters.

Other pages in Template Languages