5.14.0 • Published 7 months ago

gatsby-source-lever v5.14.0

Weekly downloads
409
License
MIT
Repository
github
Last release
7 months ago

gatsby-source-lever

Source plugin for pulling data into Gatsby from Lever.co.

Wish list

  • gatsby source plugin for Lever.co
  • tests
  • example site

Install

npm install gatsby-source-lever

How to use

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: "gatsby-source-lever",
      options: {
        // Your Lever site instance name.
        site: "lever",
        // Set verboseOutput to true to display a verbose output on `npm run develop` or `npm run build`
        // It can help you debug specific API Endpoints problems
        verboseOutput: false,
      },
    },
  ],
}

GraphQL Query to get all jobs

  allLever {
    edges {
      node {
        id
        lever_id
        createdAt
        text
        hostedUrl
        applyUrl
        categories {
          commitment
          location
          team
        }
        description
        descriptionPlain
        lists {
          text
          content
        }
        additional
        additionalPlain
      }
    }
  }

Site's gatsby-node.js example

If you wish to create Gatsby Pages for each Lever.co jobs, you can modify your gatsby-node.js.

const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)
const { slash } = require(`gatsby-core-utils`)

exports.createPages = ({ graphql, actions }) => {
  const { createPage } = actions
  return new Promise((resolve, reject) => {
    // The “graphql” function allows us to run arbitrary
    // queries against the local WordPress graphql schema. Think of
    // it like the site has a built-in database constructed
    // from the fetched data that you can run queries against.

    // ==== PAGES (LEVER) ====
    graphql(
      `
        {
          allLever {
            edges {
              node {
                id
              }
            }
          }
        }
      `
    )
      .then(result => {
        if (result.errors) {
          console.log(result.errors)
          reject(result.errors)
        }

        // Create Lever pages.
        const pageTemplate = path.resolve("./src/templates/page.js")
        // We want to create a detailed page for each
        // lever node. We'll just use the ID for the slug.
        _.each(result.data.allLever.edges, edge => {
          // Gatsby uses Redux to manage its internal state.
          // Plugins and sites can use functions like "createPage"
          // to interact with Gatsby.
          createPage({
            // Each page is required to have a `path` as well
            // as a template component. The `context` is
            // optional but is often necessary so the template
            // can query data specific to each page.
            path: `/${edge.node.id}/`,
            component: slash(pageTemplate),
            context: {
              id: edge.node.id,
            },
          })
        })
      })
      // ==== END PAGES ====

      // resolve() must be called at the end so Gatsby knows that we're done add pages.
      .then(resolve())
  })
}
5.14.0

7 months ago

5.15.0-next.0

7 months ago

5.14.0-next.3

1 year ago

5.13.1

1 year ago

5.14.0-next.1

1 year ago

5.14.0-next.2

1 year ago

5.13.0

1 year ago

5.14.0-next.0

2 years ago

5.12.0

2 years ago

5.13.0-next.0

2 years ago

5.11.0-next.0

2 years ago

5.11.0-next.1

2 years ago

5.10.0

2 years ago

5.11.0

2 years ago

5.12.0-next.0

2 years ago

5.10.0-next.2

2 years ago

5.10.0-next.1

2 years ago

5.10.0-next.0

2 years ago

5.9.0

2 years ago

5.8.0-next.0

2 years ago

5.8.0

2 years ago

5.9.0-next.0

2 years ago

5.7.0

2 years ago

5.4.0

2 years ago

5.6.0-next.0

2 years ago

5.5.0

2 years ago

5.7.0-next.0

2 years ago

5.6.0

2 years ago

4.25.0

3 years ago

5.1.0-next.0

3 years ago

5.0.0

3 years ago

5.5.0-next.0

2 years ago

5.1.0

3 years ago

5.2.0

3 years ago

5.3.0-next.0

3 years ago

5.3.0

3 years ago

5.0.0-next.1

3 years ago

5.0.0-next.2

3 years ago

5.0.0-next.0

3 years ago

5.2.0-next.0

3 years ago

3.15.0

3 years ago

5.4.0-next.0

3 years ago

5.4.0-next.1

2 years ago

4.24.0

3 years ago

4.24.0-next.0

3 years ago

4.23.0-next.0

3 years ago

4.23.0

3 years ago

4.22.0

3 years ago

4.25.0-next.0

3 years ago

4.21.0-next.0

3 years ago

4.18.0-next.1

3 years ago

4.18.0-next.0

3 years ago

4.16.0

3 years ago

4.16.0-next.0

3 years ago

4.22.0-next.0

3 years ago

4.19.0-next.1

3 years ago

4.19.0-next.0

3 years ago

4.15.0

3 years ago

4.18.0

3 years ago

4.21.0

3 years ago

4.17.0-next.0

3 years ago

4.17.0

3 years ago

4.20.0

3 years ago

4.20.0-next.0

3 years ago

4.19.0

3 years ago

4.15.0-next.0

3 years ago

4.14.0

3 years ago

4.13.0

3 years ago

4.14.0-next.1

3 years ago

4.14.0-next.2

3 years ago

4.14.0-next.0

3 years ago

4.12.0-next.0

3 years ago

4.11.0-next.0

3 years ago

4.11.0-next.1

3 years ago

4.10.0

3 years ago

4.13.0-next.0

3 years ago

4.12.0

3 years ago

4.12.1

3 years ago

4.11.0

3 years ago

4.9.0

3 years ago

4.10.0-next.0

3 years ago

4.10.0-next.1

3 years ago

4.6.0-next.0

3 years ago

4.8.0

3 years ago

4.7.0

3 years ago

4.7.0-next.0

3 years ago

4.6.0

3 years ago

4.5.0-next.0

4 years ago

4.5.0

3 years ago

4.4.0

4 years ago

4.8.0-next.0

3 years ago

4.3.0

4 years ago

4.9.0-next.0

3 years ago

4.4.0-next.0

4 years ago

4.3.0-next.0

4 years ago

4.2.0

4 years ago

4.2.0-next.0

4 years ago

4.1.0

4 years ago

4.0.0

4 years ago

4.1.0-next.0

4 years ago

4.0.0-zz-next.2

4 years ago

3.14.0

4 years ago

4.0.0-zz-next.1

4 years ago

4.0.0-zz-next.8

4 years ago

4.0.0-next.1

4 years ago

4.0.0-next.0

4 years ago

3.14.0-next.2

4 years ago

3.14.0-next.1

4 years ago

3.13.0

4 years ago

3.14.0-next.0

4 years ago

3.12.0

4 years ago

3.13.0-next.0

4 years ago

3.12.0-next.3

4 years ago

3.12.0-next.2

4 years ago

3.12.0-next.1

4 years ago

3.11.0

4 years ago

3.12.0-next.0

4 years ago

3.10.0

4 years ago

3.11.0-next.0

4 years ago

3.10.0-next.1

4 years ago

3.9.0

4 years ago

3.10.0-next.0

4 years ago

3.8.0

4 years ago

3.9.0-next.0

4 years ago

3.6.0

4 years ago

3.8.0-next.0

4 years ago

3.8.0-next.1

4 years ago

3.7.1

4 years ago

3.7.0

4 years ago

3.7.0-next.2

4 years ago

3.7.0-next.1

4 years ago

3.6.0-next.0

4 years ago

3.5.0

4 years ago

3.4.0

4 years ago

3.5.0-next.0

4 years ago

3.7.0-next.0

4 years ago

3.3.0

4 years ago

3.4.0-next.0

4 years ago

3.3.0-next.1

4 years ago

3.2.0

4 years ago

3.3.0-next.0

4 years ago

3.1.0

4 years ago

3.2.0-next.0

4 years ago

3.1.0-next.2

4 years ago

3.0.0

4 years ago

3.1.0-next.1

4 years ago

3.1.0-next.0

4 years ago

3.0.0-v3rc.0

4 years ago

3.0.0-next.0

4 years ago

2.10.0

4 years ago

2.11.0-next.0

4 years ago

2.9.0

4 years ago

2.10.0-next.0

4 years ago

2.8.0

4 years ago

2.9.0-next.0

4 years ago

2.7.0

5 years ago

2.8.0-next.0

5 years ago

2.6.0

5 years ago

2.7.0-next.0

5 years ago

2.5.0

5 years ago

2.6.0-next.0

5 years ago

2.4.0

5 years ago

2.4.0-next.1

5 years ago

2.5.0-next.0

5 years ago

2.4.0-next.0

5 years ago

2.3.15

5 years ago

2.3.14

5 years ago

2.3.13

5 years ago

2.3.12

5 years ago

2.3.11

5 years ago

2.3.10

5 years ago

2.3.9

5 years ago

2.3.7

5 years ago

2.3.6

5 years ago

2.3.5

5 years ago

2.3.4

5 years ago

2.3.3

5 years ago

2.3.2

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.29

5 years ago

2.1.28

5 years ago

2.1.27

5 years ago

2.1.26

5 years ago

2.1.25

5 years ago

2.1.24

5 years ago

2.1.23

5 years ago

2.1.22

6 years ago

2.1.20

6 years ago

2.1.19

6 years ago

2.1.18

6 years ago

2.1.17

6 years ago

2.1.16

6 years ago

2.1.15

6 years ago

2.1.14

6 years ago

2.1.13

6 years ago

2.1.12

6 years ago

2.1.10

6 years ago

2.1.9

6 years ago

2.1.8

6 years ago

2.1.7

6 years ago

2.1.6

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.9

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.6-alpha.0

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

2.0.0-rc.5

7 years ago

2.0.0-rc.1

7 years ago

2.0.0-rc.0

7 years ago

2.0.0-beta.4

7 years ago

2.0.0-beta.3

7 years ago

2.0.0-beta.2

7 years ago

2.0.0-beta.1

7 years ago

2.0.0-beta.0

7 years ago

1.0.11

7 years ago

2.0.0-alpha.2

7 years ago

1.0.9-13

7 years ago

1.0.9-12

7 years ago

1.0.9-11

7 years ago

1.0.9-10

7 years ago

1.0.9-7

7 years ago

1.0.9-6

7 years ago

1.0.9-5

7 years ago

1.0.9-4

7 years ago

1.0.9-3

7 years ago

1.0.10

7 years ago

1.0.9-2

7 years ago

1.0.9-1

7 years ago

1.0.9

7 years ago

1.0.9-0

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago