@amagaki/amagaki-plugin-greenhouse
v1.7.0
Published
[![NPM Version][npm-image]][npm-url] [![GitHub Actions][github-image]][github-url] [![TypeScript Style Guide][gts-image]][gts-url]
Downloads
24
Readme
amagaki-plugin-greenhouse
An Amagaki plugin for fetching content from Greenhouse. By default, content is sanitized using DOMPurify.
Usage
As a plugin
- Install the plugin.
npm install --save @amagaki/amagaki-plugin-greenhouse
- Add to
amagaki.ts
.
import {GreenhousePlugin} from '@amagaki/amagaki-plugin-greenhouse';
import {BuilderPlugin, Pod} from '@amagaki/amagaki';
export default (pod: Pod) => {
// Sync Greenhouse prior to building.
const builderPlugin = pod.plugins.get('BuilderPlugin') as BuilderPlugin;
builderPlugin.addBeforeBuildStep(async () => {
const greenhouse = GreenhousePlugin.register(pod, {
boardToken: 'boardToken',
});
await greenhouse.bindCollection({
collectionPath: '/content/jobs',
});
await greenhouse.saveEducationFile({
podPath: '/content/partials/education.yaml',
});
});
};
Via the CLI
This package is also distributed with a CLI so you can download Greenhouse job board data without using Amagaki.
npx @amagaki/amagaki-plugin-greenhouse download \
-b <boardToken> \
-j <jobsCollectionPodPath> \
-e <educationPodPath> \
[root]