@ilrock/gridsome-source-prismic

1.0.4 • Public • Published

@ilrock/gridsome-source-prismic

Prismic source for Gridsome. This package is under development

Supported field types

  • UID
  • Title
  • Rich text
  • Image
  • Link
  • Link to media (except link to document)
  • Date
  • Timestamp
  • Color
  • Number
  • Key text
  • Select
  • Boolean

Install

  • npm i @ilrock/gridsome-source-prismic
  • yarn add @ilrock/gridsome-source-prismic

Usage

// gridsome.config.js
module.exports  = {
  plugins: [
    {
      use: "@ilrock/gridsome-source-prismic",
      options: {
        prismic_url: "YOUR_PRISMIC_API_URL",
        prismic_token: "YOUR_PRISMIC_TOKEN",
        collection_prefix: "Prismic"
      }
    }
  ]
}

Custom routes

Likely, for some of the collections that will get created you will want to have custom routes set up.

Let's assume you have two document types created in Prismic:

  • Post
  • Project

By default the plugin will create two collections inside your GraphQL schema:

  • PrismicPost
  • PrismicProject
// gridsome.config.js
module.exports = {
  templates: {
    PrismicPost: '/posts/:slug',
    PrismicProject: '/projects/:slug'
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @ilrock/gridsome-source-prismic

Weekly Downloads

2

Version

1.0.4

License

ISC

Unpacked Size

5.92 kB

Total Files

4

Last publish

Collaborators

  • ilrock