Questions tagged [eleventy]

Eleventy (11ty) is a static site generator. Use this tag for questions about the generator itself or about the usage of it.

Eleventy is a Node.js-based static site generator. It is template/framework-agnostic, works with multiple template languages, from Markdown to Liquid, or just JavaScript.

  • Good performance
  • Templating engine-independent
  • Framework-agnostic, no JavaScript runtime
  • Layout inheritance
  • Shortcodes
  • Custom 'filter' to modify content in multiple template engines
  • Generate pages from static JSON files

Find out more at 11ty.dev.


Resources

Competitors

261 questions
3
votes
2 answers

How can I use 11ty to generate one page per json file in _data subfolders?

I'm trying to use 11ty to generate pages for a movie review site. The structure of my _data folder is as follows. _data movies 2017 title1.json title2.json 2018 2019 I'm hoping for output like this. _site movies …
centralscru
  • 6,580
  • 3
  • 32
  • 43
3
votes
0 answers

How to prevent eleventy/nunjucks from escaping content inside a for loop

When using a {% for ... %} loop inside an included nunjucks template (e.g. {% include ... %}) in eleventy, the generated contents of the loop are rendered inside
...
blocks. Here is the contents of the…
ra9r
  • 4,528
  • 4
  • 42
  • 52
3
votes
1 answer

How do I incorporate Multiple Markdown files into a Nunjucks template with Eleventy?

CONTEXT: Eleventy and Nunjucks (and Markdown) A lot of long-form text (easier to create/edit using markdown). Complex layouts. Still new to SSGs GOAL: Manage chunks of text content using markdown. Use these markdown files with template…
gabrimo
  • 53
  • 6
2
votes
2 answers

Linkedin share link image not showing

When the button on my website is pressed, I want the link of my website to be shared on LinkedIn. But when the button is pressed, the image I specified in the meta tags does not appear on the share page. In addition, the description and title…
2
votes
2 answers

Multi-level pagination in 11ty?

All the documentation I've found on Eleventy pagination has to do with a single level, and I've got that working pretty well. Take a collection (ex. of tags) and create one page each Take a collection of posts and put 10 on each page and so…
Kelson
  • 106
  • 1
  • 6
2
votes
0 answers

How can I get 11ty to recognize an in-page link as the current page? homepage#about = page.url

I'm making my first 11ty blog. I am wanting to have 3 sections on my home page.
...
...
...
I've made a navigation with links to…
NicoleR
  • 23
  • 5
2
votes
1 answer

how to prevent creating a separate folder for each markdown blog while generating html in 11ty?

what I have: src blog blog1.md blog2.md blog3.md After building site what I'm getting: _site blog blog1 index.html blog2 index.html blog3 index.html What I actually want is this: _site blog …
2
votes
0 answers

Unable to load CSS, font, and image contents to Nunjuck files in 11ty

I'm building a site using 11ty with Nunjucks. The CSS, font, and image contents are working in the index.njk file, but all other nunjuck files do not load CSS, font, or image contents. I got a 404 status error and so I think the issue is I'm not…
Mohammed Asker
  • 97
  • 1
  • 1
  • 14
2
votes
1 answer

How to insert block of html into eleventy template

I'm trying to move a website from python to eleventy. My file structure is in the screenshot above. I've been following some tutorials such as https://dev.to/loige/getting-started-with-eleventy-in-11-minutes-496j, as well as the eleventy docs…
user1592380
  • 34,265
  • 92
  • 284
  • 515
2
votes
0 answers

Can I render a Nunjucks Template inside an 11ty shortcode?

I have a Nunjucks shortcode in an Eleventy project. It's added to configuration in eleventy.js with the Eleventy addNunjucksAsyncShortcode method. My shortcode has gotten extremely messy with complex HTML string literals, and I'd like to refactor it…
webstackdev
  • 850
  • 15
  • 23
2
votes
1 answer

What is the proper way to include partial in liquid templates in eleventy 1?

Given the following file structure: root/ src/ _includes/ partials/ navbar.liquid footer.liquid address.liquid base.liquid index.liquid How do I include partials/navbar.liquid and partials/footer.liquid…
mike
  • 1,786
  • 2
  • 19
  • 31
2
votes
1 answer

using frontmatter as data in 11ty

I need some help setting a featured image frontmatter parameter. I've been trying for hours to get this working and can't seem to figure it out. --- title: My post date: 2020-02-23 published: true thumb: '/assets/img/img.jpg' tags: - Tag 1 -…
Xoog
  • 908
  • 1
  • 10
  • 30
2
votes
1 answer

Iterate over global data subfolder in Eleventy / 11ty

I'm using Eleventy and have created the subfolder yummy in my global data folder, that contains the following files: \src\_data\yummy\drinks.json \src\_data\yummy\food.json When I use {{ yummy | dump }} I get the following…
Liu Kang
  • 1,359
  • 4
  • 22
  • 45
2
votes
1 answer

11ty - How do I display post / page year?

I'm using Eleventy and using Posts. I have set the date in the meta data using the format date: 2021-09-10. I can display the full date using {{ page.date | readableDate }} But I want to display just the year (YYYY) within the post content. I'm…
2
votes
1 answer

script not loading after navigate from one page to another page nunjucks

i am creating website using nunjucks and express, its king of blog website and content coming from prismic. i want to load one script file for active campane form when user navigate from blog list page to any blog detail page, after navigate to…
Trushar Narodia
  • 3,511
  • 2
  • 11
  • 17
1
2
3
17 18