Posts tagged with “eleventy”

Eleventy: Set Nunjucks as the Default Markdown Template Engine

Despite using Nunjucks as my default templating language in Eleventy, for a long time, I was hesitant to just put markdownTemplateEngine: "njk" in my Eleventy configuration file, because I kept getting errors in the terminal about the nodes of my articles or blog posts did not exist, due to a conflict with the official Eleventy Navigation plugin.

Today I finally solved the issue by adding eleventyNavigation.key to my breadcrumb set up, so the Eleventy Navigation plugin would dynamically read my eleventyNavigation.key key for each post or article. Now I no longer have to individually add templateEngineOverride: njk, md in a post or article's frontmatter.


Nunjucks' built-in `wordcount` filter

I just learned through the eleventy-plugin-wordcount-extended plugin that Nunjucks has a built-in wordcount filter, but it does not correctly calculate the word count of non-ASCII strings, including Chinese characters and emojis.


Eleventy Configuration File Organisation

Organised my Eleventy configuration files by splitting the code blocks for different purposes, including filters, shortcodes, markdown-it plugins, and so on, into their own files, then importing them into my main configuration file (eleventy.config.js).