Permalinks are your friend - existing site converstion - Eleventy tricks

Blog Home Index & Contents

First attempt at 11ty Permalinks


I put the following permalink line into almost all of my front matter areas. It tells Eleventy where and what to name the rendered file. This is a real file myLayout.njk used in my Eleventy setup:

My Permalink Example

In this case page.filePathStem is the name of the file to the left of the file extension. So in this example it will create "name of file".html. For example: in the file reunion.html page.filePathStem = reunion there is no directory structure specified in the Permalink, so Eleventy will create the file reunion.html in the same folder. You could also specify something like Permalink: "404.html" and it will name the file 404.html in the same directory. Nice huh?