@developersgarage/sourcebit-target-eleventy

0.3.1 • Public • Published

sourcebit-target-eleventy

[npm version

A Sourcebit plugin for the 11ty static site generator

👩‍🏫 Introduction

This plugin creates a JavaScript file (_data/data.js) to expose any Sourcebit data source through JavaScript properties consumable by the 11ty static site generator.

🏗 Installation

To install the plugin and add it to your project, run:

npm install sourcebit-target-eleventy --save

💡 You don't need to run this command if you start Sourcebit using the interactive setup process, as the CLI will install the plugin for you and add it as a dependency to your project.

⚙️ Configuration

The plugin accepts the following configuration parameters. They can be supplied in any of the following ways:

  • In the options object of the plugin configuration block inside sourcebit.js, with the value of the Property column as a key;
Property Type Visibility Default value Env variable Parameter Description
contentModels String Array Public false A list of strings representing the content model names to be included as part of the data object used to create the pages

👀 Example configuration

sourcebit.js

module.exports = {
    plugins: [
        {
            module: require('sourcebit-target-eleventy'),
            contentModels: ['blog', 'about']
        }
    ]
};

🧞‍♂️ Interactive setup process

This plugin offers an interactive setup process via the npx create-sourcebit command. It asks users to select each of the content models present in the models data bucket to be accessbile within 11ty.

📥 Input

This plugin expects the following data buckets to exist:

  • models: An array of content models
  • objects: An array of objects with data corresponding to the models

📤 Output

This plugin creates creates a JavaScript (data.js) file in the _data folder.

Analytics

Package Sidebar

Install

npm i @developersgarage/sourcebit-target-eleventy

Weekly Downloads

2

Version

0.3.1

License

MIT

Unpacked Size

29.7 kB

Total Files

13

Last publish

Collaborators

  • developersgarage