GithubHelp home page GithubHelp logo

yassineelbouchaibi / strapi-plugin-website-builder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from strapi-community/strapi-plugin-website-builder

0.0 0.0 0.0 72 KB

A plugin for Strapi Headless CMS that provides the ability to trigger website builds manually, periodically or through model events.

Home Page: https://market.strapi.io/plugins/strapi-plugin-website-builder

License: MIT License

JavaScript 100.00%

strapi-plugin-website-builder's Introduction

strapi-plugin-website-builder

A plugin for Strapi that provides the ability to trigger website builds manually, periodically or through model events.

Requirements

The installation requirements are the same as Strapi itself and can be found in the documentation on the Quick Start page in the Prerequisites info card.

Supported Strapi versions

  • v4.x.x

NOTE: While this plugin may work with the older Strapi versions, they are not supported, it is always recommended to use the latest version of Strapi.

Installation

npm install strapi-plugin-website-builder

or

yarn add strapi-plugin-website-builder

Configuration

The plugin configuration is stored in a config file located at ./config/plugins.js.

The plugin has different structures depending on the type of trigger for the build. Each of the following sample configurations is the minimum needed for their respective trigger type.

Manual Configuration

module.exports = ({ env }) => ({
 'website-builder': {
    enabled: true,
    config: {
      url: 'https://link-to-hit-on-trigger.com',
      trigger: {
        type: 'manual',
      },
    }
  },
});

Cron/Periodic Configuration

module.exports = ({ env }) => ({
 'website-builder': {
    enabled: true,
    config: {
      url: 'https://link-to-hit-on-trigger.com',
      trigger: {
        type: 'cron',
        cron: '* * 1 * * *',
      },
    }
  },
});

Event Configuration

module.exports = ({ env }) => ({
 'website-builder': {
    enabled: true,
    config: {
      url: 'https://link-to-hit-on-trigger.com',
      trigger: {
        type: 'event',
        events: [
          {
            model: 'recipes',
            types: ['create', 'delete'],
          },
        ],
      },
    }
  },
});

IMPORTANT NOTE: Make sure any sensitive data is stored in env files.

The Complete Plugin Configuration Object

Property Description Type Required
url The trigger URL for the website build. String Yes
headers Any headers to send along with the request. Object No
body Any body data to send along with the request. Object No
secret Secret key to sign body of the request with. Object No
secret.hash Algorith to use for signing e.g. sha1, sha256, etc. string Yes
secret.headerKey Header key where the signature should be stored. string Yes
secret.secretKey Secret key to sign body with. string Yes
trigger The trigger conditions for the build. Object Yes
trigger.type The type of trigger. The current supported options are manual,cron and event String Yes
trigger.cron The cron expression to use for cron trigger. The supported expressions are the same as in the strapi docs String Only if the type is cron
trigger.events The events to use for the event trigger. Array Only if the type is event
trigger.events.model The model to listen for events on. String Yes
trigger.events.types The model events to trigger on. The current supported events are create, update and delete Array Yes

Usage

Once the plugin has been installed and configured, it will show in the sidebar as Website Builder. To trigger a manual build select the Website Builder menu item in the sidebar and click the Trigger Build button to start a build process.

Bugs

If any bugs are found please report them as a Github Issue

strapi-plugin-website-builder's People

Contributors

comfortablycoding avatar yassineelbouchaibi 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.