Using page variables in shortcodes · Issue #607 · 11ty/eleventy
Hi -- Is it possible to use page object variables inside a shortcode? I'm attempting to refactor the following njk block into a shortcode à la adamduncan/eleventy-shortcomps pattern: {%- for im...
How to pass a variable to a shortcode · Issue #298 · 11ty/eleventy
I'm trying to create a shortcode that needs to have in input variables eleventyConfig.addShortcode("twittershare", function(canonicalUrl, textToShare, viaName, hastagName) { return `&...
If you've built sites using Eleventy, you're probably familiar with collections. Using the Configuration API allows for creating custom collections which can be useful to only show certain posts on your site.
Generate Page Content From a Global Data File Using Eleventy
There are many great features to choose from when building websites with Eleventy. One feature in particular that I find very useful is the ability to iterate over a global data file and generate page content using a templating language of your choice.
How to create a Tags collection and a Categories collection in Eleventy
I have the following two blocks of code in my .eleventy.js file
// Tags
eleventyConfig.addCollection('tagList', collection => {
const tagsSet = new Set();
collection.getA...
11ty filter to filter a collection (array) by key:value pair - used to filter on custom taxonomies other than tags (source: https://paulrobertlloyd.com/)
11ty filter to filter a collection (array) by key:value pair - used to filter on custom taxonomies other than tags (source: https://paulrobertlloyd.com/) - 11ty_contains.js
11ty filter for returning a sorted list of tags from collections. Use the it in a template like {{ collections.foo | taglist }} to get the sorted tag list.
11ty filter for returning a sorted list of tags from collections. Use the it in a template like {{ collections.foo | taglist }} to get the sorted tag list. - sort-tags.js
Shorter shortcuts through Nunjucks macros in Eleventy | BryceWray.com
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.
Using Nunjucks 'If Expressions' in 11ty to create a simple active navigation state
In this tutorial, we'll set up a simple navigation, identify what page navigation item we need to activate based on URL parts and add an active class to that element with no need of an if tag
I have a simple Eleventy site v0.11.0
I'm using tag in the front matter to generate collections.
Ex:
---
title: Some post
tags:
- apple
- banana
- soccer
---
I want to show a list each of each ...
Filters in Eleventy (11ty) are a way to mutate data including string variables or arrays such as collections. Learn to create a filter for use on a collection which will select a random item from the collection.
How to use nunjucks macro inside markdown files ? · Issue #613 · 11ty/eleventy
Hi ! Question I would like to create a macro to embed images inside a <figure> with a <figcaption> tag. I'm trying to use nunjucks macro inside my markdown files but it doesn't ...
Passing Object Arguments to Liquid Shortcodes in 11ty | Aleksandr Hovhannisyan
Currently, 11ty doesn't allow you to pass object arguments to shortcodes in Liquid. As a temporary workaround, you can assemble and parse a JSON string to pass along to the shortcode as an argument.
A Set of Useful 11ty Filters | Aleksandr Hovhannisyan
One of my favorite things about 11ty is its flexibility and how easily you can customize your chosen template language without having to leave the familiar comfort of the Node ecosystem.