Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Dec 1, 2019
1 parent 86ab771 commit 79bc30e
Showing 1 changed file with 43 additions and 15 deletions.
58 changes: 43 additions & 15 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ Glob support is {% addedin "0.6.0" %}.

```bash
# The current directory
eleventy --input=.
npx @11ty/eleventy --input=.

# A single file
eleventy --input=README.md
npx @11ty/eleventy --input=README.md

# A glob of files (New in v0.6.0)
eleventy --input=*.md
npx @11ty/eleventy --input=*.md

# A subdirectory
eleventy --input=views
npx @11ty/eleventy --input=views
```

##### Configuration
Expand Down Expand Up @@ -122,7 +122,7 @@ The includes directory is meant for [Eleventy layouts](/docs/layouts/), include

{% codetitle ".eleventy.js" %}

```
```js
module.exports = {
dir: {
// ⚠️ This value is relative to your input directory.
Expand Down Expand Up @@ -151,7 +151,7 @@ This configuration option is optional but useful if you want your [Eleventy layo

{% codetitle ".eleventy.js" %}

```
```js
module.exports = {
dir: {
// ⚠️ These values are both relative to your input directory.
Expand All @@ -178,7 +178,7 @@ Controls the directory inside which the global data template files, available to

{% codetitle ".eleventy.js" %}

```
```js
module.exports = {
dir: {
// ⚠️ This value is relative to your input directory.
Expand All @@ -202,7 +202,7 @@ Controls the directory inside which the finished templates will be written to.

{% codetitle ".eleventy.js" %}

```
```js
module.exports = {
dir: {
output: "dist"
Expand All @@ -225,7 +225,7 @@ The `data.dir` global data files run through this template engine before transfo

{% codetitle ".eleventy.js" %}

```
```js
module.exports = {
"dataTemplateEngine": "njk"
};
Expand All @@ -246,7 +246,7 @@ Markdown files run through this template engine before transforming to HTML.

{% codetitle ".eleventy.js" %}

```
```js
module.exports = {
markdownTemplateEngine: "njk"
};
Expand All @@ -267,7 +267,7 @@ HTML templates run through this template engine before transforming to (better)

{% codetitle ".eleventy.js" %}

```
```js
module.exports = {
htmlTemplateEngine: "njk"
};
Expand All @@ -289,15 +289,15 @@ Specify which types of templates should be transformed.

{% codetitle ".eleventy.js" %}

```
```js
module.exports = {
templateFormats: ["html", "liquid", "njk"]
};
```

{% codetitle ".eleventy.js" %}

```
```js
module.exports = function(eleventyConfig) {
eleventyConfig.setTemplateFormats("html,liquid,njk");

Expand All @@ -307,11 +307,39 @@ module.exports = function(eleventyConfig) {
```

```
eleventy --formats=html,liquid,njk
npx @11ty/eleventy --formats=html,liquid,njk
```

{% callout "info" %}{% addedin "0.9.0" %} <strong>Case sensitivity</strong>: File extensions should be considered case insensitive, cross-platform. While Mac OS—by default—already behaves this way, other operating systems do not and needed additional Eleventy code to enable this behavior.{% endcallout %}

### Enable Quiet Mode to Reduce Console Noise

In order to maximize user-friendliness to beginners, Eleventy will show each file it processes and the output file. To disable this noisy console output, use quiet mode!

| Path Prefix | |
| --- | --- |
| _Default_ | `false` |
| _Valid Options_ | `true` or `false` | |
| _Command Line Override_ | `--quiet` |

{% addedin "0.10.0" %} This configuration API method was added in 0.10.0 but the `--quiet` command line option has existed long before that.

#### Example

{% codetitle ".eleventy.js" %}

```js
module.exports = function(eleventyConfig) {
eleventyConfig.setQuietMode(true);
};
```

The command line will override any setting in configuration:

```
npx @11ty/eleventy --quiet
```

### Deploy to a subdirectory with a Path Prefix

If your site lives in a different subdirectory (particularly useful with GitHub pages), use pathPrefix to specify this. It’s used by the `url` filter and inserted at the beginning of all absolute url href links. It does not affect your file structure. Leading or trailing slashes are all normalized away, so don’t worry about it.
Expand All @@ -336,7 +364,7 @@ module.exports = {
Deploy to https://11ty.github.io/eleventy-base-blog/ on GitHub pages without modifying your config. This allows you to use the same code-base to deploy to either GitHub pages or Netlify, like the [`eleventy-base-blog`](https://github.com/11ty/eleventy-base-blog) project does.

```
eleventy --pathprefix=eleventy-base-blog
npx @11ty/eleventy --pathprefix=eleventy-base-blog
```

<a id="{{ 'Copy Files to Output using Pass-through File Copy' | slug }}"></a>
Expand Down

0 comments on commit 79bc30e

Please sign in to comment.