Use the Pug template engine to create pages and layouts


Pug is a template engine heavily influenced by Haml. This plugin allows you to use it to create pages and layouts.


Import this plugin in your _config.ts file to use it:

import lume from "lume/mod.ts";
import pug from "lume/plugins/pug.ts";

const site = lume();


export default site;

See all available options in Deno Doc.

Creating layouts

Add a file with .pug extension in the _includes directory. Use the front matter to set data for the template.

title: Welcome to my page
intro: This is my first post using Lume. I hope you like it!

doctype html
    title= title

    include partials/nav.pug

    p= title

Note that the paths passed to include are relative to _includes directory.

Creating pages

Creating pages is the same as creating layouts; just place the .pug file outside the _includes directory.