diff --git a/src/docs/config.md b/src/docs/config.md index 47416b0bdb..9ac5b6b954 100644 --- a/src/docs/config.md +++ b/src/docs/config.md @@ -247,7 +247,7 @@ Specify which types of templates should be transformed. | _Default_ | `html,liquid,ejs,md,hbs,mustache,haml,pug,njk,11ty.js` | | _Valid Options_ | Array of [template engine short names](/docs/languages/) | | _Command Line Override_ | `--formats` _(accepts a comma separated string)_ | -| _Configuration API_ | `setTemplateFormats` {% addedin "0.2.14" %} | +| _Configuration API_ | `setTemplateFormats` {% addedin "0.2.14" %} and `addTemplateFormats` {% addedin "0.11.0" %} | {% callout "info" %}{% addedin "0.9.0" %} Case sensitivity: File extensions should be considered case insensitive, cross-platform. While macOS already behaves this way (by default), other operating systems require additional Eleventy code to enable this behavior.{% endcallout %} @@ -267,10 +267,15 @@ There are many [different shapes of configuration file](/docs/config-shapes.md). {% set codeContent %} export default function (eleventyConfig) { + // Reset to this value eleventyConfig.setTemplateFormats("html,liquid,njk"); + // Additive to existing + eleventyConfig.addTemplateFormats("pug,haml"); + // Or: // eleventyConfig.setTemplateFormats([ "html", "liquid", "njk" ]); + // eleventyConfig.addTemplateFormats([ "pug", "haml" ]); }; {% endset %} {% include "snippets/configDefinition.njk" %} diff --git a/src/docs/usage.md b/src/docs/usage.md index 1828718c00..8c8ea1e2dd 100644 --- a/src/docs/usage.md +++ b/src/docs/usage.md @@ -41,6 +41,9 @@ A hypothetical `template.md` in the current directory would be rendered to `_sit # Use only a subset of template types npx @11ty/eleventy --formats=md,html,ejs +# Don’t process any formats +npx @11ty/eleventy --formats= + # Find out the most up-to-date list of commands (there are more) npx @11ty/eleventy --help {% endset %} @@ -55,6 +58,8 @@ npx @11ty/eleventy --help