Giter Club home page Giter Club logo

prismic-toolbar's Introduction

Prismic toolbar

The prismic toolbar enables content writers to:

  • Identify Prismic content on the page
  • Preview unpublished changes (drafts and releases)
  • Perform A/B tests (experiments)

How to use it?

Include the following script on every page of your site (including the 404 page).

Remember to replace YOUR_REPO_NAME with the name of your Prismic repository.

<script src=//prismic.io/prismic.js?repo=YOUR_REPO_NAME></script>

How to develop

  • Start your toolbar locally:
npm start
  • Serve toolbar assets:
npm run serve

It will serve assets at http://localhost:8081/prismic-toolbar/[version]. Where version is current package.json version.

  • Change the path of the script to point to http://localhost:8081/prismic-toolbar/[version]/prismic.js from your public folder

By default the toolbar will communicate with prismic.io so the local [version] must match the version served by prismic.

With a proxy

If you are using a proxy in front of the development server, you must set the CDN_HOST environment variable, so the script will be loaded through the proxy.

Example:

CDN_HOST=http://wroom.test npm start

Then from your project, load the prismic script like this:

<script src=//wroom.test/prismic-toolbar/[version]/prismic.js?repo=repo_name.wroom.test></script>

Note that the repo name should be qualified with your proxy domain for the communication to work.

How to deploy

  • Deploy on prod:
npm run build:prod

prismic-toolbar's People

Contributors

adampflug avatar aigrefin avatar arnaudlewis avatar gaberogan avatar greenkeeper[bot] avatar krabbypattified avatar levimykel avatar lihbr avatar marcmcintosh avatar michelchau avatar mikemjharris avatar odiim avatar raph22 avatar srenault avatar veloce avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.