0.1.3 • Published 3 months ago

kg-eleventy-plugin-wordpress v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

eleventy-plugin-wordpress

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.

npm install --save kg-eleventy-plugin-wordpress

Configuration

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 tags

See files in the dev folder for an example.

0.1.3

3 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago