8 posts by Trevor Morris
Eleventy Collections from an API
I've been tinkering with a new Eleventy project and decided to fire it up using the 3 beta version. I started by creating two collections using markdown files. Each collection had a template data file which pointed to a specific layout template for the individual posts.…
Sep 24, 2024
by Trevor Morris (8 posts) · Website & RSS feed
Categories: CollectionsFiltersHow to...Pagination
Dynamic Importing with Eleventy
After organising Eleventy filters, shortcodes etc I had an idea to tidy the code even more and make it dynamic. I wanted to automatically import any new functions that were added, including new when using files.
Aug 28, 2024
by Trevor Morris (8 posts) · Website & RSS feed
Categories: CollectionsConfigurationFiltersHow to...Shortcodes
Eleventy Filters in Collections
If you're building up a custom Eleventy collection using addCollection, you may need to use existing filters to create the desired data.
Aug 26, 2024
by Trevor Morris (8 posts) · Website & RSS feed
Categories: CollectionsFiltersHow to...
Organising Eleventy Filters, Shortcodes and more…
I work a lot with the Laravel framework, which scaffolds much of your initial setup and has conventions for where code should be stored. Starting a brand new Eleventy project from scratch doesn't give you this boilerplate and means you have to make decisions about where everything lives.
Aug 22, 2024
by Trevor Morris (8 posts) · Website & RSS feed
Categories: ConfigurationFiltersHow to...Shortcodes
Eleventy Date Filter with Ordinals
When working with dates in JavaScript, you probably reach for a library to help you parse, manipulate and display the values. For a recent Eleventy project, I used Luxon – the successor to the popular JavaScript date/time library Moment.js. I used this because the dependency is already used within Eleventy itself.
Aug 20, 2024
Organizing NPM Build Scripts
I recently took an existing codebase and ported it over to Eleventy. The main purpose was to recreate the website with existing markdown files and CSS. Creating the collections and templates was the bulk of the work, but I also needed the CSS to work.
Jun 27, 2024
by Trevor Morris (8 posts) · Website & RSS feed
Categories: Asset PipelinesCSS/SassHow to...
Eleventy JSON Output
For a small Eleventy-based project, I wanted to output an example.json file – stored in the data folder – in a Nunjucks template. If you simply output the variable example, you'll see the unhelpful [object Object] text.
Sep 29, 2023
CAUTION
The posts below were published before the release of Eleventy v2.0.0 (Feb 8, 2023). Information in these posts may be out of date. The current stable release is 3.01.
Using the Netlify CMS locally
I have recently been building a few websites using Eleventy. This is a static site generator, built using Jamstack methodology.
Jan 18, 2022