Tagged “Eleventy”

  1. Using date-fns to Build Cleaner Date Filters in Eleventy
  2. Add a title and copy button to the Eleventy (11ty) SyntaxHighlighter

Using date-fns to Build Cleaner Date Filters in Eleventy

September 30, 2024 • 11ty • Eleventy • posts

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 →

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

September 29, 2024 • 11ty • Eleventy • posts

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 →