Eleventy Tricks
Jamie
June 12, 2024
I recently moved this site away from Hugo and onto Eleventy. Given my simple needs, I was attracted to Eleventy because it too is simple and flexible. Unfortunately, those very positive traits mean that developers may need to invent a few features for themselves — one size does not fit all, after all. This page collects some of the tricks, and snippets I ended up with for this site to function as I wanted it to. There may be better ways, but these worked for me. Global Data I like to define "variables" for things I refer to often across the site. I chose to define these in .eleventy.js as global data: These are then accessible in your templates, via e.g.: Global data is a big concept in Eleventy, so be sure to read the docs. Excerpts In Hugo, I used the
Discussion in the ATmosphere