1.0.4 • Published 4 years ago

@ilrock/gridsome-source-prismic v1.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

@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'
  }
}
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago