Nunjucks/Macros 43 posts
Category: NUNJUCKS/MACROS (43 posts)
2025
Eleventy - todayโs date as a global variable
Sometimes, you want to use today's date in a template. One example is a copyright notice that includes the current year. Not all templating languages provide a simple way to get the current date.
By Rob O'Leary (13 posts)
Using esbuild in Eleventy
The personal website of Dan Cฤtฤlin Burzo.
By Dan Cฤtฤlin Burzo (6 posts)
Updated Bookmarks
I've been using raindrop for my bookmarks and updated my bookmarks page
By Clayton Errington (19 posts)
Mastering Eleventy: Display All Blog Posts from a Category on a Single Page
Have the same topic on your 11ty website and want to view them all on one page? Here's how to do so with just one extra file, and no plugins needed.
By Gregory Hammond (3 posts)
Creating a modular approach to json schema in an eleventy website
I wanted a modular and automated way to add json schema to my personal website so built a set of templates and some simple logic to populate the schema.
By Simon Cox (16 posts)
11ty OpenGraph & SEO
re implementing opengraph and meta tags in 11ty using javascript and nunjucks
By equilibriumuk (19 posts)
Wrapper Elements around Code Blocks in Markdown
Creating proportional, equal-height image rows with CSS, 11ty, and Nunjucks
Hi, Iโm Jeremy. I build things on the web and share what I learn on my blog.
By Jeremy Robert Jones (1 post)
Calculating yearsSince using a Nunjucks filter in Eleventy
Vento: My Favourite Template Language for Eleventy
I have switched to using Vento as the template engine in my websites built with Eleventy, and I love it.
By Helen Chong (7 posts)
How I built dynamic social media images in Eleventy using Cloudinary
My not very sophisticated but very understandable approach to making social media share images for a blog in Eleventy.
By Chip Cullen (2 posts)
Taking VentoJS for a spin in Elevยญenty
Presenting an episode on your site
Automagically generating a robots.txt file in Eleventy using data and Nunjucks
Writing some code to make better a thing I've been doing manually.
By Thomas Rigby (8 posts)
2024
Adding Random Content Using Eleventy
Learn how to use Eleventy to add dynamic, random content like film quotes or targeted Q&A sections to your website. A step-by-step guide with practical examples and code snippets.
By Stu Robson (1 post)
Eleventy - Zero JS charts
It'd be cool to be able to sprinkle in some charts to your website easily. And without a lick of client-side JavaScript.
By Rob O'Leary (13 posts)
Dynamic Content Includes
In this post, I explain how I solved two issues at the same time by introducing a feature to my post layout that Iโm calling pre and post includes.
By Chris Burnell (8 posts)
A custom collection to sort events with Eleventy
I made a custom collection with a filter to sort events by their custom date data.
By Sami Mรครคttรค (6 posts)
Refactor by shortcode
I decided to take on some overdue refactoring of the 11tybundle.dev site. Here's what I did.
By Bob Monsour (20 posts)
Different favicon for development build
How to make tabs in the browser always show which build youโre working on.
By Nikita Dubko (1 post)
2023
Grouping posts by year with nunjucks in Eleventy
Creating a Category Filter in Eleventy
Now I have a few posts, it would be good to have some way to narrow them down when looking for something specific.
By Thomas Rigby (8 posts)
From Nunjucks to Liquid
Changing the template language from nunjucks to Liquid in my eleventy project
By Morten Birch (1 post)
Time to move on from Nunjucks?
Here are some points to consider about how you should build and maintain Eleventy sites going forward.
By Bryce Wray (26 posts)
11ty, nunjucks, tag counts
Components with Nunjucks and 11ty
We are going to be go through the first steps to get up and running with 11ty. Building a 11ty site from scratch will help you keep your site lightweight, scalable and easy to manage.
By Jeremy Faucher (8 posts)
2022
Shorter shortcuts through Nunjucks macros in Eleventy
While seeking a way to cut a three-line call down to one line, I found some great advice on using a sometimes-overlooked aspect of a popular templating language.
By Bryce Wray (26 posts)
Using Eleventy transforms to render asynchronous content inside Nunjucks macros
11ty quick tip: Nunjucks include in markdown without indentation
If you're not careful, included files are not correctly rendered.
By Tim Kleyersburg (2 posts)
Nunjucks Conditional Statement Examples for Eleventy
We are going to be go through the first steps to get up and running with 11ty. Building a 11ty site from scratch will help you keep your site lightweight, scalable and easy to manage.
By Jeremy Faucher (8 posts)
Using Storybook with Nunjucks components in Eleventy
2021
Includes and Macros
Comparing techniques for encapsulating HTML components in Nunjucks or Jinja2.
By Evan Sheehan (8 posts)
Reusable code snippets and components in Eleventy
Some cunning ways to use Nunjucks and 11ty shortcodes for reusable blocks
By Laurence Hughes (4 posts)
Using parameters in your eleventy includes with nunjucks macros
Includes are great. But for actual reusability of code, parameters are always needed. Luckily, nunjucks makes this possible with macros!
By Thomas Semmler (3 posts)
Modular code with Nunjucks and Eleventy
These days, web development and design are all about modularization and components. Template languages have a lot to offer and Eleventy itself has a few tricks up its sleeve.
By Jรฉrรดme Coupรฉ (10 posts)
Using Nunjucks shortcodes in Markdown files in Eleventy
Encapsulated Eleventy/Nunjucks components with macros
2020
Back to Nunjucks for my Eleventy site
Why Iโve decided for now to backtrack from JavaScript-only templating in Eleventy.
By Bryce Wray (26 posts)
Twitter Cards with Nunjucks and 11ty
Using cards makes sharing your content on Twitter look much nicer.
By Tom Hazledine (3 posts)