eleventyNavigation | ||||||
---|---|---|---|---|---|---|
|
These examples assume local project installation instead of global installation.
# Searches the current directory, outputs to ./_site
npx @11ty/eleventy
If you’re using a global install of Eleventy, remove npx @11ty/
from the beginning of each command, like so:
# Global installation
eleventy
{% codewithprompt "npxeleventy", "last" %}
--input=. --output=_site {% endcodewithprompt %}
Read more about --input
and --output
.
A hypothetical template.md
in the current directory would be rendered to _site/template/index.html
. Read more at Permalinks.
{% codewithprompt "npxeleventy", "last" %}
--formats=md,html,ejs {% endcodewithprompt %}
{% codewithprompt "npxeleventy", "last" %}
--help {% endcodewithprompt %}
{% codewithprompt "npxeleventy", "last" %}
--serve {% endcodewithprompt %}
{% codewithprompt "npxeleventy", "last" %}
--serve --port=8081 {% endcodewithprompt %}
{% callout "info" %}Important Note: Browsersync requires a <body>
tag in your template for live-reload to work properly.{% endcallout %}
{% codewithprompt "npxeleventy", "last" %}
--watch {% endcodewithprompt %}
{% codewithprompt "npxeleventy", "last" %}
--quiet {% endcodewithprompt %}
Runs without writing to the file system. Useful when debugging.
{% codewithprompt "npxeleventy", "last" %}
--dryrun {% endcodewithprompt %}
{% codewithprompt "npxeleventy", "last" %}
--config=myeleventyconfig.js {% endcodewithprompt %}
Yes, you can use the same input
and output
directories, like so:
{% codewithprompt "npxeleventy", "last" %}
--input=. --output=. --formats=md {% endcodewithprompt %}
{% callout "warn" %}Careful with --formats=html
here! If you run eleventy more than once, it’ll try to process the output files too. Read more at the HTML template docs.{% endcallout %}