eleventyNavigation | ||||
---|---|---|---|---|
|
{% templatelangs templatetypes, page %}
There are a couple of different ways you can tell Eleventy how you want to process a file:
- The file extension (importantly, this is also used to find files to process).
- Configuration options:
markdownTemplateEngine
: The default global template engine to pre-process markdown files. Usefalse
to avoid pre-processing and only transform markdown.htmlTemplateEngine
: The default global template engine to pre-process HTML files. Usefalse
to avoid pre-processing and passthrough copy the content (HTML is not transformed, so technically this could be any plaintext).
templateEngineOverride
in the template’s front matter. Should be one templating engine (liquid
) or markdown paired with another templating engine (liquid,md
). See examples below.
If your file is called example.liquid
—instead of liquid
, this will be parsed as a njk
Nunjucks template:
{% codetitle "example.liquid" %}
---
templateEngineOverride: njk
---
Remember that—by default—Markdown files are processed with an additional preprocessor template engine set globally with the markdownTemplateEngine
configuration option. So, when using templateEngineOverride
on markdown files be sure to list each templating engine you’d like to use.
For example, you may want to process njk
Nunjucks first and then md
markdown afterwards. Markdown is supported either by itself or with another engine. No other templating engines can be combined in this way—Markdown is the exception here. Any other combination attempt will throw an error.
---
templateEngineOverride: md
---
---
templateEngineOverride: njk,md
---
Any falsy value here will just copy the template content without transformation.
---
templateEngineOverride: false
---