Asian Americans Advancing Justice — Stand Against Hatred
Eleventy The possum is Eleventy’s mascot

Eleventy Documentation

Menu

Command Line Usage #

These examples assume local project installation instead of global installation.

# Searches the current directory, outputs to ./_site
npx @11ty/eleventy
Warning: Using npx eleventy instead of npx @11ty/eleventy may work if you already have Eleventy installed globally or in your local project but it is not recommended! If Eleventy is not already installed this will download and execute the wrong package. So make sure you run npx @11ty/eleventy (including the @11ty/ prefix!).

If you’re using a global install of Eleventy, remove npx @11ty/ from the beginning of each command, like so:

# Global installation
eleventy
# `npx @11ty/eleventy` is the same as:
npx @11ty/eleventy --input=. --output=_site

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.

# Use only a subset of template types
npx @11ty/eleventy --formats=md,html,ejs
# Find out the most up-to-date list of commands (there are more)
npx @11ty/eleventy --help

Re-run Eleventy when you save #

# Boot up a Browsersync web server to apply changes and
# refresh automatically. We’ll also --watch for you.
npx @11ty/eleventy --serve
# Change the web server’s port—use localhost:8081
npx @11ty/eleventy --serve --port=8081
Important Note: Browsersync requires a <body> tag in your template for live-reload to work properly.
# Automatically run when input template files change.
# Useful if you have your own web server.
npx @11ty/eleventy --watch

--quiet if the Output is Too Noisy #

# Shhhhh—Don’t log so much to the console
npx @11ty/eleventy --quiet

--dryrun to do a Little Testing #

Runs without writing to the file system. Useful when debugging.

# Run Eleventy but don’t write any files
npx @11ty/eleventy --dryrun

--config to Change the Config file name #

# Override the default eleventy project config filename (.eleventy.js)
npx @11ty/eleventy --config=myeleventyconfig.js

Examples #

Using the Same Input and Output #

Yes, you can use the same input and output directories, like so:

# Parse and write Markdown to HTML, respecting directory structure.
npx @11ty/eleventy --input=. --output=. --formats=md
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.

Other pages in Getting Started: