1.0.7 • Published 3 years ago

gatsby-source-bludit v1.0.7

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

GitHub license demo npm gatsby bludit

gatsby-source-bludit

Description

This Gatsby Source plugin allows you to pull in data from your Bludit site via the Bludit API.

Dependencies

  • node-fetch

How to install

npm install gatsby-source-bludit

Examples of what to add to your gatsby-config.js in the plugins array:

    {
      resolve: `gatsby-source-bludit`,
      options: {
        url: "https://<YOUR-BLUDIT-URL>/api/pages",
        token: process.env.GATSBY_BLUDIT_TOKEN,
        numberOfItems: "10", // Only available on the /api/pages endpoint
        rootKey: "BluditPages"
      },
    },
    {
      resolve: `gatsby-source-bludit`,
      options: {
        url: "https://<YOUR-BLUDIT-URL>/api/categories",
        token: process.env.GATSBY_BLUDIT_TOKEN,
        rootKey: "BluditCategories"
      },
    },
  • The example above shows setting two endpoints for usage.
  • The examples above are using an environment variable to include the Bludit Token securely. Learn More

Options

NameTypeDescription
urlstringRequired Url of your API endpoint.
tokenstringRequired API Token.
rootKeystringRequired Name the endpoint.
numberOfItemsstringOptional Number of items to return. Only used for the /api/pages endpoint. Default is set to return all.

How to query for data

export const query = graphql`
  {
    allBluditPages {
      edges {
        node {
          id
          coverImage
          title
          permalink
          slug
        }
      }
    }
  }
`;

Be sure to set the allBluditPages above to use the rootKey that you set for the endpoint.

How to contribute

Any contribution, feedback, and PRs are very welcome. Issues is the preferred method of submitting feedback.

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago