nuxtjs-prismic

    1.2.2 • Public • Published

    @nuxtjs/prismic

    npm version Github Actions CI Codecov License

    Headless CMS meets Universal Apps - Nuxt.js module for Prismic.

    See live demo with the demo source code.

    Installation

    $ yarn add @nuxtjs/prismic
    

    Features

    • Batteries Included: Easily access official Prismic JavaScript & Prismic DOM libraries in your Nuxt.js app.
    • Preview Mode: Automatically add Prismic Previews to your site without additional configuration.
    • Compact Configuration: Just add your Prismic repository endpoint and a link resolver and you're good to go.
    • Prismic Components: Accelerate your workflow with ready-to-use Prismic components

    Quick Start

    Install @nuxtjs/prismic and add the following minimal configuration to nuxt.config.js;

    ...
    modules: [
      '@nuxtjs/prismic'
    ],
    prismic: {
      endpoint: 'https://<REPOSITORY>.cdn.prismic.io/api/v2',
      apiOptions: { // optional
        accessToken: '<private_access_token>',
        routes: [
          {
            "type": "page",
            "path": "/:uid"
          }
        ]
      }
    }

    Then create ~/app/prismic/link-resolver.js:

    export default function (doc) {
      return '/'
    }

    You can now access Prismic inside your Nuxt.js app through the $prismic variable. Follow our Getting Started guide for further documentation and examples.

    Node v8 Support

    Since v0.5.0, @nuxtjs/prismic should now work with Node v8 and above. We don't manually test on Node v8, however unit tests will now be tested on both Node v8 and V10 on Travis. There's no guarantees that it'll work as expected, especially after Node v8 drops out of support in January 2020.

    Install

    npm i nuxtjs-prismic

    DownloadsWeekly Downloads

    1

    Version

    1.2.2

    License

    MIT

    Unpacked Size

    31.7 kB

    Total Files

    15

    Last publish

    Collaborators

    • zhangpengchen