Skip to content

Commit

Permalink
missing options in fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
lexoyo committed Apr 20, 2024
1 parent b57949a commit 9a0067c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Here are additional options specific to this plugin:
| `enable11ty` | Enable the 11ty integration. If false, the publication will not publish to 11ty and do not display 11ty data. | `true` |
| `esModules` | Enable ES modules in the 11ty data files which is needed for **11ty version > 2**. If false, the data files will be CommonJS modules. | `true` |
| `cacheBuster` | Add cache buster to graphql queries | `false` |
|`fetchPlugin`|Options to pass to [11ty fetch plugin](https://www.11ty.dev/docs/plugins/fetch/)|`{ duration: '1d', type: 'json' }`|
|`fetchPlugin`|Options to pass to [11ty fetch plugin](https://www.11ty.dev/docs/plugins/fetch/)|`{ duration: '1d' }`|
|`imagePlugin`|Enable the 11ty image block and an `image` filter, both assume that your eleventy site has the [11ty image plugin installed](https://www.11ty.dev/docs/plugins/image/). Values can be `false` (off), `webc` or `transform` (check 11ty image docs)|`false`|
|`i18nPlugin`|Enable filters which assume that your eleventy site has the [11ty i18n plugin installed](https://www.11ty.dev/docs/plugins/i18n/)|`false`|
|`dir`|An object with options to define 11ty directory structure|`{}`|
Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface EleventyPluginOptions extends DataSourceEditorOptions {
cacheBuster?: boolean,
// 11ty fetch plugin options
// https://www.11ty.dev/docs/plugins/fetch/
// Default: { duration: '1d', type: 'json' }
// Default: { duration: '1d' }
fetchPlugin?: object | false,
// Image plugin enabled to add specific filters
// https://www.11ty.dev/docs/plugins/image/
Expand Down
1 change: 0 additions & 1 deletion src/client/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export function getZeroConfig(config: ClientConfig): EleventyPluginOptions {
// 11ty plugins
fetchPlugin: {
duration: '1s',
type: 'json',
},
imagePlugin: 'transform',
i18nPlugin: true,
Expand Down
1 change: 1 addition & 0 deletions src/client/publication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ export function makeFetchCallEleventy(options: {key: string, url: string, method
try {
result['${options.key}'] = (await EleventyFetch(\`${options.url}\`, {
...${JSON.stringify(fetchPlugin)},
type: 'json',
fetchOptions: {
headers: {
${options.headers}
Expand Down

0 comments on commit 9a0067c

Please sign in to comment.