Stand with Ukraine 🇺🇦
Eleventy
The possum is Eleventy’s mascot

Eleventy Documentation

WARNING:
This is an older version of Eleventy. Go to the newest Eleventy docs (current path: /docs/languages/html/) or the full release history.
Menu

HTML

Template Languages:

Eleventy Short Name File Extension npm Package
html .html N/A

HTML files can be optionally pre-processed with an additional template engine. This can be configured on a per-template basis or globally. Read more at Changing a Template’s Rendering Engine.

Using the Same Input and Output Directories Jump to heading

WARNING:
This is a Common Pitfall.

Careful with the HTML template type when using the same --input and --output directory (this is not the default).

If you run eleventy more than once, it’ll try to process your output files too.

$ eleventy --input=. --output=. --formats=md,html
Writing ./README/index.html from ./README.md

$ eleventy --input=. --output=. --formats=md,html
Writing ./README/index.html from ./README.md
Writing ./README/index-o.html from ./README/index.html

If you’re going to use --formats=html, it’s probably best not using the same input and output directories.

Moreover, you may notice in the above output that the second template wrote to index-o.html. When the input and output directories are the same and the source template is named index.html, we add an -o suffix to avoid overwriting itself. This is a special case that only applies to index.html filenames. You can customize the -o suffix with the htmlOutputSuffix configuration option.


Other pages in Template Languages:


Related Docs