Slugify URLs

Slugify all page URLs to remove potentially conflicting characters

Options See on

extensions string[] *

The list of extensions this plugin applies to

[ ".html" ]


The slugify_urls plugin converts all URLs in your pages and files by removing or replacing potentially conflicting characteres like accents, spaces, etc.

Once enabled, the output paths are automatically slugified: the spaces are replaced with -, characters like ñ or á are replaced by ASCII equivalents (n and a), and converted to lower case:

/posts/My First  =>  /posts/my-first-post/index.html


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

import lume from "lume/mod.ts";
import slugifyUrls from "lume/plugins/slugify_urls.ts";

const site = lume();


export default site;


By default, only HTML pages are slugified. If you want to apply the plugin to other files, like jpg images, use the extensions option:

  extensions: [".html", ".jpg"],

Or set a * to slugify all files:

  extensions: "*",

Slugify options

You can configure the slugifier with the following options:

/* Default options */

  lowercase: true, // Converts all characters to lowercase
  alphanumeric: true, // Replace non-alphanumeric characters with their equivalent. Example: ñ to n.
  separator: "-", // Character used as separator for words
  stopWords: ["and", "or", "the"], // A list of words not included in the slug
  replace: { // An object with individual character replacements
    "Ð": "D", // eth
    "ð": "d",
    "Đ": "D", // crossed D
    "đ": "d",
    "ø": "o",
    "ß": "ss",
    "æ": "ae",
    "œ": "oe",