Skip to content

Commit 2b85c92

Browse files
authored
Update README.md
1 parent d4c5b34 commit 2b85c92

File tree

1 file changed

+30
-48
lines changed

1 file changed

+30
-48
lines changed

README.md

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,103 +4,85 @@ A plugin to make building with Eleventy and Netlify a joy!
44

55
### Speed up your builds ⚡
66
- Caches images generated by [@11ty/eleventy-img](https://github.com/11ty/eleventy-img) across builds
7-
- Caches assets fetched by [@11ty/eleventy-cache-assets](https://github.com/11ty/eleventy-cache-assets) across builds
7+
- Caches assets fetched by [@11ty/eleventy-fetch](https://github.com/11ty/eleventy-fetch) across builds
88
- Caches any other folders of your choice (optional)
99

1010
## Install
1111

1212
Install plugin via your package manager of choice:
1313

14-
<!-- **Note**: Till https://github.com/11ty/eleventy-img/pull/116 is merged,
15-
please use [this fork](https://github.com/zeroby0/eleventy-img/tree/cache) instead of `@11ty/eleventy-img`.
16-
17-
```bash
18-
npm r @11ty/eleventy-img
19-
npm i zeroby0/eleventy-img#cache
20-
npm i netlify-plugin-11ty
21-
``` -->
22-
2314
```bash
2415
npm i netlify-plugin-11ty
2516
```
2617

27-
And add the plugin to your `netlify.toml` file
28-
29-
```toml
30-
[[plugins]]
31-
package = "netlify-plugin-11ty"
32-
```
33-
34-
Aand you're done! 🥳
35-
36-
You can read Netlify's documentation about Plugins here: https://docs.netlify.com/configure-builds/build-plugins/
37-
38-
## Configuration
39-
40-
**Optional**. You can configure the plugin to suit your project's needs.
41-
42-
**Example**:
18+
And add the plugin to your `netlify.toml` file:
4319

4420
```toml
4521
[[plugins]]
4622
package = "netlify-plugin-11ty"
4723
[plugins.inputs]
48-
cache_img = './img'
24+
# eleventy-img outputDir, path relative to publish directory
25+
cache_img = 'img/'
4926
cache_img_httpHeader = false
5027

51-
cache_assets = '../.cache'
28+
# eleventy-fetch cacheDir, path relative to publish directory
29+
cache_assets = '../.cache/'
5230
cache_other = []
5331
```
5432

55-
The following `inputs` options are available:
33+
Make sure the path for [`cache_img`](#1-cache_img) is correct. Aand you're done! 🥳
34+
35+
You can read Netlify's documentation about Plugins here: https://docs.netlify.com/configure-builds/build-plugins/
36+
37+
## Documentation
38+
39+
### 1. `cache_img`
5640

57-
### 1. `cache_img`
58-
**Type**: `String` or `Array of Strings`
59-
**Default**: `'./img'` (relative to the publish
60-
directory)
41+
Type: `String` or `Array of Strings`
42+
Default: `'img'` (relative to the publish directory)
6143

62-
The folder(s) in which files generated by `@11ty/eleventy-img` are stored,
44+
Path to the folder(s) in which files generated by `@11ty/eleventy-img` are stored,
6345
relative to the publish directory. Can be a String or an array of Strings.
6446

6547
If set to `false`, files generated by `@11ty/eleventy-img` are not saved in
6648
Netlify cache.
6749

6850
### 2. `cache_img_httpHeader`
6951

70-
**Type**: `Boolean`
71-
**Default**: `false`
52+
Type: `Boolean`
53+
Default: `false`
7254

7355
If set to `true`, files generated by `@11ty/eleventy-img` will be served with
7456
http header `cache-control: public, max-age=31536000, immutable`.
7557

7658
Files generated by `eleventy_img` have a hash calculated using file content and
7759
[Sharp plugin options](https://www.11ty.dev/docs/plugins/image/#advanced-control-of-sharp-image-processor)
7860
in their name by default ([starting from #116](https://github.com/11ty/eleventy-img/pull/116)),
79-
so you can cache them indefinitely.
61+
so you can cache them indefinitely. Don't use this if you're using remote images.
8062

81-
If you are using [custom filenames](https://www.11ty.dev/docs/plugins/image/#custom-filenames-new-in-image-0.4.0)
82-
that don't include a hash, this option should be left `false` (default).
63+
:warning: **Caution**:
64+
- If you are using remote images, this option should be `false` (default).
65+
- If you are using [custom filenames](https://www.11ty.dev/docs/plugins/image/#custom-filenames-new-in-image-0.4.0)
66+
that don't include a hash, this option should be `false` (default).
8367

8468
### 3. `cache_assets`
8569

86-
**Type**: `String` or `Array of Strings`
87-
**Default**: `'../.cache'` (relative to the
88-
publish directory)
70+
Type: `String` or `Array of Strings`
71+
Default: `'../.cache'` (relative to the publish directory)
8972

90-
The folder(s) in which remote assets fetched by `@11ty/eleventy-cache-assets`
73+
Path to the folder(s) in which remote assets fetched by [@11ty/eleventy-fetch](https://github.com/11ty/eleventy-fetch)
9174
are cached, relative to publish directory. Can be a String or an array of
9275
Strings.
9376

94-
If set to `false`, assets fetched by `@11ty/eleventy-cache-assets` are not saved
77+
If set to `false`, assets fetched by `@11ty/eleventy-fetch` are not saved
9578
in Netlify cache.
9679

9780
### 4. `cache_other`
9881

99-
**Type**: `String` or `Array of Strings`
100-
**Default**: `[]` (relative to the publish
101-
directory)
82+
Type: `String` or `Array of Strings`
83+
Default: `[]` (relative to the publish directory)
10284

103-
Any other folder(s) you'd like to cache across Netlify builds. If these folders
85+
Paths to any other folder(s) you'd like to cache across Netlify builds. If these folders
10486
exist before restoring Nelify cache, their content will be merged and overwritten
10587
with content from the cached folders.
10688

0 commit comments

Comments
 (0)