https://github.com/panoply/11ty
║ An Eleventy wrapper for type supported configurations
https://github.com/panoply/11ty
11ty eleventy types typings wrapper
Last synced: 9 days ago
JSON representation
║ An Eleventy wrapper for type supported configurations
- Host: GitHub
- URL: https://github.com/panoply/11ty
- Owner: panoply
- Archived: true
- Created: 2022-05-15T04:35:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-19T16:28:54.000Z (over 1 year ago)
- Last Synced: 2025-10-04T06:35:22.329Z (10 days ago)
- Topics: 11ty, eleventy, types, typings, wrapper
- Language: JavaScript
- Homepage:
- Size: 95.7 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
Awesome Lists containing this project
README
PROJECT HAS MOVED
This project has a new home! Install via the NPM Registry 11ty.ts
→ 11ty.ts Repository
→ NPM Registry/i>---
# @panoply/11ty (Type Support)
Shareable [Eleventy](https://www.11ty.dev/) configuration strap. The module can be dropped in to your `.eleventy.js` configuration file for Typed supported configuration options.
### Why?
Type support is assumed nowadays and when modules don't provide this basic capability it makes life difficult and reflects poorly on otherwise good projects (like Eleventy). The team behind Eleventy has floated type support but seem hesitant and from my understanding were considering using JSDoc types. We are not animals. We live in a society.
##### References
- https://github.com/11ty/eleventy/issues/2317
- https://github.com/11ty/eleventy/pull/2091
- https://github.com/11ty/eleventy/pull/720
- https://github.com/11ty/eleventy/issues/814# Install
The module requires [@11ty/eleventy](https://www.npmjs.com/package/@11ty/eleventy) be installed along side it.
```cli
pnpm add @panoply/11ty @11ty/eleventy -D
```> The `@11ty/eleventy` module is a peer. You need to install it.
# Usage
Pass it to the `module.exports` within a `.eleventy.js` or `.eleventy.cjs` configuration file.
```ts
const eleventy = require("@panoply/11ty");module.exports = eleventy(function(config) {
config.setBrowserSyncConfig();
config.addPlugin()return {
htmlTemplateEngine: 'liquid',
passthroughFileCopy: false,
pathPrefix: '',
templateFormats: [
'liquid',
'json',
'md',
'css',
'html',
'yaml'
],
dir: {
input: 'site',
output: 'public',
includes: 'views/include',
layouts: 'views/layouts',
data: 'data'
}
}
});
```### Typed Plugins
Due to the way Eleventy digests plugins, Type support is rather difficult to apply without manually including plugins and comparing `typeof` which is a real mess. I am open to ideas if folks have any because without complete typed support leveraging Eleventy is like taming a wild beast.
### License
[MIT](#LICENSE)