Nunjucks/Macros 43 posts

Category: NUNJUCKS/MACROS (43 posts)

2025

favicon for site or author

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)

favicon for site or author

Using esbuild in Eleventy

The personal website of Dan Cฤƒtฤƒlin Burzo.

By Dan Cฤƒtฤƒlin Burzo (6 posts)

favicon for site or author

Updated Bookmarks

I've been using raindrop for my bookmarks and updated my bookmarks page

By Clayton Errington (19 posts)

favicon for site or author

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)

favicon for site or author

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)

favicon for site or author

11ty OpenGraph & SEO

re implementing opengraph and meta tags in 11ty using javascript and nunjucks

By equilibriumuk (19 posts)

favicon for site or author

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

Replacing an imported dependency with vanilla javascript

By Thomas Rigby (8 posts)

favicon for site or author

Journa11ty

A new simple eleventy blog template

By Clayton Errington (19 posts)

favicon for site or author

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)

favicon for site or author

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)

Presenting an episode on your site

Documentation website for eleventy-plugin-podcaster.

By Nathan Bottomley (2 posts)

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

favicon for site or author

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)

favicon for site or author

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)

favicon for site or author

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)

favicon for site or author

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)

favicon for site or author

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)

favicon for site or author

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

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)

favicon for site or author

From Nunjucks to Liquid

Changing the template language from nunjucks to Liquid in my eleventy project

By Morten Birch (1 post)

Categories
favicon for site or author

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)

Categories
favicon for site or author

11ty, nunjucks, tag counts

Using nunjucks to get the count of the posts for a tag.

By Clayton Errington (19 posts)

favicon for site or author

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

favicon for site or author

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)

Categories

Using Eleventy transforms to render asynchronous content inside Nunjucks macros

Multiline Comment โ€ข The online journal of Ashur Cabrera

By Ashur Cabrera (8 posts)

favicon for site or author

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)

favicon for site or author

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

Multiline Comment โ€ข The online journal of Ashur Cabrera

By Ashur Cabrera (8 posts)

2021

favicon for site or author

Includes and Macros

Comparing techniques for encapsulating HTML components in Nunjucks or Jinja2.

By Evan Sheehan (8 posts)

Categories
favicon for site or author

Reusable code snippets and components in Eleventy

Some cunning ways to use Nunjucks and 11ty shortcodes for reusable blocks

By Laurence Hughes (4 posts)

favicon for site or author

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)

favicon for site or author

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)

Categories
favicon for site or author

Using Nunjucks shortcodes in Markdown files in Eleventy

Unlock the power of Eleventy Image in your md posts

By Cassey Lottman (12 posts)

favicon for site or author

Encapsulated Eleventy/Nunjucks components with macros

How to pass parameters to an include in Nunjucks

By Trys Mudford (2 posts)

Categories

2020

favicon for site or author

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)

Categories
favicon for site or author

Twitter Cards with Nunjucks and 11ty

Using cards makes sharing your content on Twitter look much nicer.

By Tom Hazledine (3 posts)

Some content below may have been published before the release of Eleventy v3.0.0 (October 1, 2024). Information may have changed in newer versions. Current stable release: 3.12
Some content below may have been published before the release of Eleventy v2.0.0 (Feb 8, 2023). Information may have changed in newer versions. Current stable release: 3.12.
Some content below may have been published before the release of Eleventy v1.0.0 (Jan 8, 2022). Information may have changed in newer versions. Current stable release: 3.12.
All of the content below was published before the release of Eleventy v1.0.0 (Jan 8, 2022). Information may have changed in newer versions. Current stable release: 3.12.