Latest Posts

Add a title and copy button to the Eleventy (11ty) SyntaxHighlighter

September 29, 2024. #11ty #Eleventy

The official Eleventy public `@11ty/eleventy-plugin-syntaxhighlight` allows code to be highlighted in markdown content using the Prism JS library for syntax highlighting. The following code demonstrates how to add a title bar and copy code button to make it easier to borrow code from the generated website. The code is a wrapper around the Eleventy Syntaxhighlight plugin.

Read More →

Using date-fns to Build Cleaner Date Filters in Eleventy

September 30, 2024. #11ty #Eleventy

Eleventy doesn’t provide built-in date formatting filters, so you need to define them manually in your eleventy.config.js. This post demonstrates how format dates in 11ty using the widely adopted date-fns JavaScript library. Date-fns offers a large set of lightweight formatting utilities, has good documentation and can be simpler and more intuitive to use than Luxon.

Read More →