https://github.com/kevingimbel/eleventy-plugin-wordpress
11ty 🤝 WordPress
https://github.com/kevingimbel/eleventy-plugin-wordpress
Last synced: about 2 months ago
JSON representation
11ty 🤝 WordPress
- Host: GitHub
- URL: https://github.com/kevingimbel/eleventy-plugin-wordpress
- Owner: KevinGimbel
- Created: 2024-01-05T16:22:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-18T14:16:12.000Z (over 1 year ago)
- Last Synced: 2025-04-05T12:43:54.715Z (about 2 months ago)
- Language: HTML
- Size: 33.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# eleventy-plugin-wordpress
- [What is this plugin?](#what-is-this-plugin)
- [Support](#support)
- [Goals](#goals)
- [Non-goals](#non-goals)
- [Usage](#usage)
- [Installation](#installation)
- [Configuration](#configuration)
- [Template usage](#template-usage)## What is this plugin?
This plugin loads various things out of WordPress and makes it available as data-source in 11ty.
## Support
This plugin is **very unsupported** and intended for my own usage. I'm open-sourcing it as I like to share all the code I write, and if you find it useful feel free to use the plugin with your own website(s).
**Expect breaking changes as I build the plugin to fits my needs**
The plugin is also quite slow, it takes between 4-5 seconds to load data from a relativly small wordpress page (~300 Tags, 16 Pages, 138 posts)
### Goals
- Load content (Pages, Posts, Tags, Categories) out of wordpress and use it to render a static website with 11ty
### Non-goals
- Load Media files
## Usage
### Installation
Install the plugin via npm, then configure it.```sh
npm install --save kg-eleventy-plugin-wordpress
```### Configuration
```js
const EleventyWP = require('kg-eleventy-plugin-wordpress');module.exports = (eleventyConfig, options) => {
eleventyConfig.addPlugin(EleventyWP, {
base_url: "https://example.com"
});
// [rest of config]
};
```### Template usage
The plugin provides the following data sets:
- `wp.pages` containing all pages
- `wp.posts` containing all posts
- `wp.tags` containing all tagsSee files in the `dev` folder for an example.