1.7.0 • Published 2 years ago

@amagaki/amagaki-plugin-greenhouse v1.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

amagaki-plugin-greenhouse

NPM Version GitHub Actions TypeScript Style Guide

An Amagaki plugin for fetching content from Greenhouse. By default, content is sanitized using DOMPurify.

Usage

As a plugin

  1. Install the plugin.
npm install --save @amagaki/amagaki-plugin-greenhouse
  1. 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]