Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
81 lines (59 sloc) 2.16 KB
subtitle menuSectionName submenuSortOrder tags
Getting Started
docs-getting-started
usage
local-installation
starter
debugging
tutorials
quicktips
docs

{{ subtitle }}

Requires version 8 of Node.js or higher.

npm install -g @11ty/eleventy

Available on npm. Previously known as eleventy-cli. Read more about local installation.

Run Eleventy

Make a directory with your project in it. Don’t include ~ $ when you run these commands.

~ $ mkdir eleventy-sample
~ $ cd eleventy-sample

Run eleventy:

~/eleventy-sample $ eleventy
Wrote 0 files in 0.02 seconds

Makes sense—this is an empty folder with no templates inside. So, let’s make a few templates.

~/eleventy-sample $ echo '<!doctype html><html><head><title>Page title</title></head><body><p>Hi</p></body></html>' > index.html
~/eleventy-sample $ echo '# Page header' > README.md

We’ve now created an HTML template and a markdown template. Now run eleventy again:

~/eleventy-sample $ eleventy
Writing _site/README/index.html from ./README.md
Writing _site/index.html from ./index.html
Wrote 2 files in 0.10 seconds

This will compile any content templates in the current directory or subdirectories into the output folder (defaults to _site).

Use eleventy --serve to start up a hot-reloading local web server.

~/eleventy-sample $ eleventy --serve
Writing _site/README/index.html from ./README.md
Writing _site/index.html from ./index.html
Wrote 2 files in 0.10 seconds
Watching…
[Browsersync] Access URLs:
 ------------------------------------
       Local: http://localhost:8080

 (some output truncated)

[Browsersync] Serving files from: _site

Go to http://localhost:8080/ or http://localhost:8080/README/ to see your Eleventy site live! Save your files and watch the page refresh for you automatically.

Congratulations—you made something with Eleventy! Now put it to work with templating syntax, front matter, and data files.

➡ Continue: Command Line Usage

You can’t perform that action at this time.