Eleventy Recipes Wordmark

Eleventy Recipes

Change the default directories

By Mike Aparicio

By default, Eleventy looks for your source files in the root directory and outputs files to _site. You can change these defaults from the command line when running Eleventy, or by setting them in .eleventy.js. This helps keep your site files separate from your Eleventy config and other project files.


  1. Change the input directories from the command line
npx @11ty/eleventy --input=_src --output=_site


  1. Open .eleventy.js

  2. Within the module.exports function , enter the following

module.exports = function(eleventyConfig) {
return {
dir: {
input: '_src',
output: '_site'