Pug

Use the Pug template engine to create pages and layouts

Installation

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();

site.use(pug({/* your config here */}));

export default site;

See all available options in Deno Doc.

Description

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

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
html
  head
    title= title

  body
    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.