Giter Site home page Giter Site logo

simply007 / gatsby-preview-custom-element Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 2.19 MB

Custom element allows to subscribe for Gatsby preview functionality

License: MIT License

CSS 37.57% JavaScript 5.47% HTML 56.96%
gatsby kentico-kontent custom-element kontent-ai kontent-ai-integration

gatsby-preview-custom-element's Introduction

Kentico Kontent Gatsby Preview Custom Element

Gatsby preview custom element is watching content changes. When the change is performed it sends the notification to the GatsbyJs and notify editor that the preview environment is ready to be previewed.

Gatsby preview custom element

Usage

If you want to use the Gatsby preview custom element in your project in Kentico Kontent, follow these steps:

  • In Kentico Kontent open Content types tab
  • Open / create a content model to which you want to add the Gatsby preview custom element
  • Add Custom element content element
  • Open configuration of the content element
  • Use following URL as Hosted code URL (HTTPS): https://Simply007.github.io/gatsby-preview-custom-element/build/preview-element.html
  • Provide the following JSON parameters for the custom element to connect it to the appropriate elements
{
    "previewApiKey": "<YOUR PREVIEW API KEY>",
    "previewUrlPattern": "https://gatby-test-kc-preview/{lang}/{urlslug}",
    "urlSlugElement": "url_pattern",
    "gatsbyWebHookUrl": "https://webhook.gatsbyjs.com/hooks/data_source/<GUID>",
    "baseDomain": "https://your-proxy-for-preview-endpoint.com" // default is "https://preview-deliver.kontent.ai"
}

Setup

  1. Deploy the code to a secure public host
  2. Follow the instructions in the Kentico Kontent documentation to add the element to a content model.
    • The Hosted code URL is where you deployed to in step 1
    • No JSON parameters are necessary

Deploying

Netlify has made this easy. If you click the deploy button below, it will guide you through the process of deploying it to Netlify and leave you with a copy of the repository in your GitHub account as well.

Deploy to Netlify

Development

You can use following to set up the development environment

Prerequisites:

  • Node.js
  • git
git clone https://github.com/Simply007/gatsby-preview-custom-element
cd gatsby-preview-custom-element
npm install
npm run start

To build for production, run:

npm run build

then deploy the contents of the dist folder.

Thanks

Thanks to Martin Hejtmánek and his Preview availability custom element

gatsby-preview-custom-element's People

Contributors

simply007 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nathandcox

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.