-
-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Passthrough copy, filters, ignores ESM docs 11ty/eleventy#836
- Loading branch information
Showing
19 changed files
with
588 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{%- set tabid = "ignoresnodemod" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
// in Eleventy 2.0 | ||
eleventyConfig.ignores.delete("**/node_modules/**"); | ||
|
||
// in Eleventy 1.0 | ||
eleventyConfig.ignores.delete("node_modules/**"); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
// in Eleventy 2.0 | ||
eleventyConfig.ignores.delete("**/node_modules/**"); | ||
|
||
// in Eleventy 1.0 | ||
eleventyConfig.ignores.delete("node_modules/**"); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{%- set tabid = "ignoresoptout" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
eleventyConfig.setUseGitIgnore(false); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
eleventyConfig.setUseGitIgnore(false); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{%- set tabid = "ignores" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
eleventyConfig.ignores.add("README.md"); | ||
eleventyConfig.ignores.delete("README.md"); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
eleventyConfig.ignores.add("README.md"); | ||
eleventyConfig.ignores.delete("README.md"); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{%- set tabid = "copyadv" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
eleventyConfig.addPassthroughCopy("img", { | ||
expand: true, // expand symbolic links | ||
}); | ||
|
||
eleventyConfig.addPassthroughCopy({ img: "subfolder/img" }, { | ||
debug: true, // log debug information | ||
}); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
eleventyConfig.addPassthroughCopy("img", { | ||
expand: true, // expand symbolic links | ||
}); | ||
|
||
eleventyConfig.addPassthroughCopy({ img: "subfolder/img" }, { | ||
debug: true, // log debug information | ||
}); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{%- set tabid = "copyemu" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
// the default is "copy" | ||
eleventyConfig.setServerPassthroughCopyBehavior("passthrough"); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
// the default is "copy" | ||
eleventyConfig.setServerPassthroughCopyBehavior("passthrough"); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{%- set tabid = "copyext" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
eleventyConfig.setTemplateFormats([ | ||
"md", | ||
"css", // css is not yet a recognized template extension in Eleventy | ||
]); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
eleventyConfig.setTemplateFormats([ | ||
"md", | ||
"css", // css is not yet a recognized template extension in Eleventy | ||
]); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{%- set tabid = "copyglobs" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
// Find and copy any `jpg` files, maintaining directory structure. | ||
eleventyConfig.addPassthroughCopy("**/*.jpg"); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
// Find and copy any `jpg` files, maintaining directory structure. | ||
eleventyConfig.addPassthroughCopy("**/*.jpg"); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{%- set tabid = "copyinput" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
// Input directory: src | ||
// Output directory: _site | ||
|
||
// The following copies to `_site/img` | ||
eleventyConfig.addPassthroughCopy("src/img"); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
// Input directory: src | ||
// Output directory: _site | ||
|
||
// The following copies to `_site/img` | ||
eleventyConfig.addPassthroughCopy("src/img"); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{%- set tabid = "copymix" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
// Output directory: _site | ||
|
||
// Find and copy any `jpg` files in any folder to _site/img | ||
// Does not keep the same directory structure. | ||
eleventyConfig.addPassthroughCopy({ "**/*.jpg": "img" }); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
// Output directory: _site | ||
|
||
// Find and copy any `jpg` files in any folder to _site/img | ||
// Does not keep the same directory structure. | ||
eleventyConfig.addPassthroughCopy({ "**/*.jpg": "img" }); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{%- set tabid = "copyout" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
// Input directory: src | ||
// Output directory: _site | ||
|
||
// Copy `img/` to `_site/subfolder/img` | ||
eleventyConfig.addPassthroughCopy({ img: "subfolder/img" }); | ||
|
||
// Copy `src/img/` to `_site/subfolder/img` | ||
eleventyConfig.addPassthroughCopy({ "src/img": "subfolder/img" }); | ||
|
||
// Copy `random-folder/img/` to `_site/subfolder/img` | ||
eleventyConfig.addPassthroughCopy({ "random-folder/img": "subfolder/img" }); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
// Input directory: src | ||
// Output directory: _site | ||
|
||
// Copy `img/` to `_site/subfolder/img` | ||
eleventyConfig.addPassthroughCopy({ img: "subfolder/img" }); | ||
|
||
// Copy `src/img/` to `_site/subfolder/img` | ||
eleventyConfig.addPassthroughCopy({ "src/img": "subfolder/img" }); | ||
|
||
// Copy `random-folder/img/` to `_site/subfolder/img` | ||
eleventyConfig.addPassthroughCopy({ "random-folder/img": "subfolder/img" }); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{%- set tabid = "copy" %} | ||
<div class="codetitle codetitle-right-md">eleventy.config.js</div> | ||
<is-land on:visible import="/js/seven-minute-tabs.js"> | ||
<seven-minute-tabs class="tabs-flush" persist sync> | ||
{% renderFile "./src/_includes/syntax-chooser-tablist.11ty.js", {id: tabid, only: "jsesm,jscjs"} %} | ||
<div id="{{ tabid }}-jsesm" role="tabpanel"> | ||
|
||
```js | ||
export default function (eleventyConfig) { | ||
// Output directory: _site | ||
|
||
// Copy `img/` to `_site/img` | ||
eleventyConfig.addPassthroughCopy("img"); | ||
|
||
// Copy `css/fonts/` to `_site/css/fonts` | ||
// Keeps the same directory structure. | ||
eleventyConfig.addPassthroughCopy("css/fonts"); | ||
|
||
// Copy any .jpg file to `_site`, via Glob pattern | ||
// Keeps the same directory structure. | ||
eleventyConfig.addPassthroughCopy("**/*.jpg"); | ||
}; | ||
``` | ||
|
||
</div> | ||
<div id="{{ tabid }}-jscjs" role="tabpanel"> | ||
|
||
```js | ||
module.exports = function (eleventyConfig) { | ||
// Output directory: _site | ||
|
||
// Copy `img/` to `_site/img` | ||
eleventyConfig.addPassthroughCopy("img"); | ||
|
||
// Copy `css/fonts/` to `_site/css/fonts` | ||
// Keeps the same directory structure. | ||
eleventyConfig.addPassthroughCopy("css/fonts"); | ||
|
||
// Copy any .jpg file to `_site`, via Glob pattern | ||
// Keeps the same directory structure. | ||
eleventyConfig.addPassthroughCopy("**/*.jpg"); | ||
}; | ||
``` | ||
|
||
</div> | ||
</seven-minute-tabs> | ||
</is-land> |
Oops, something went wrong.