Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/philhawksworth/netlify-plugin-yield-data-for-eleventy
Make data from the Netlify build cache available to the Eleventy SSG
https://github.com/philhawksworth/netlify-plugin-yield-data-for-eleventy
Last synced: 16 days ago
JSON representation
Make data from the Netlify build cache available to the Eleventy SSG
- Host: GitHub
- URL: https://github.com/philhawksworth/netlify-plugin-yield-data-for-eleventy
- Owner: philhawksworth
- Created: 2019-09-26T09:41:13.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-19T13:43:26.000Z (over 4 years ago)
- Last Synced: 2024-10-26T11:18:33.694Z (18 days ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# netlify-plugin-yield-data-for-eleventy
A Netlify plugin to expose data collected to in the Netlify build cache to place and structure that [Eleventy](https://11ty.io) can use
> NOTICE: This is an experimental feature. Subject to lots of change.
## Overview
This plugin exposes data files gathered by previous operations into the Netlify build cache and exposes them to a destinations and format suitable for the Eleventy SSG to use in its templates at site generation time.
## Demonstration
See this plugin being used with a plugin which gathers RSS feed data in this simplified demo site: https://demo-plugin-fetch-feed.netlify.com
## Usage
This plugin is designed to be used in conjunction with other plugins which first gather content from remote sources and collect it in the Netlify build cache, such as [netlify-plugin-fetch-feeds](https://github.com/philhawksworth/netlify-plugin-fetch-feeds).
### Prerequisites
- npm and node
- @Netlify/build (later this will be included in the Netlify CLI)
- A free [Netlify account](https://netlify.com)
- Opt-in to Netlify Build Plugin feature support (Not yet publicly available, sorry)### Including this plugin in a project
This plugin can be included via npm. Install it as a dependency for your project like so:
```
npm install --save netlify-plugin-yield-data-for-eleventy
```### Configuration
TODO
To use plugins, a `plugins` array should be specified in your `netlify.yml`. Each plugin can then be specified with its parameters like so:
```yaml
plugins:
prime-eleventy:
type: netlify-plugin-yield-data-for-eleventy
config:
data_dir: src/site/_data
cache_sources: # An array of folders within the netlify cache where data should be sourced
- netlify-plugin-fetch-feeds
```### Execution in Netlify
Once installed and configured, the plugin will automatically run in the Netlify CI during its specified Netlify Build lifecycle event.
### Executing locally
To test the execution of the Netlify Build lifecycle locally, first ensure that netlify-build is installed:
```bash
# Ensure that you have the netlify build command available
# (in future this will be provided via the CLI)
npm install @netlify/build -g# In the project working directory, run the build as netlify would with the build bot
netlify-build
```