Skip to content

versoly/plugins

Repository files navigation

Versoly Plugins

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

Install

pnpm install @versoly/plugins

Usage

import { plugins } from '@versoly/plugins';

plugins['countup'].name
//=> 'Countup'

Create a plugin

import { defineConfig } from '@versoly/plugins';

export const calendly = defineConfig({
  name: 'Calendly',
  cdnUrls: [
    {
      url: 'https://assets.calendly.com/assets/external/widget.js',
      delay: true,
    },
    {
      url: 'https://assets.calendly.com/assets/external/widget.css',
      delay: true,
    },
  ],
  js: `
document.querySelectorAll('[data-calendly-url]').forEach(a => {
  const url = a.getAttribute('data-calendly-url')

  if (!url) {
    return;
  }

  a.addEventListener('click', e => {
    e.preventDefault();
    window.Calendly.initPopupWidget({ url, parentElement: a})
  })
});`,
  checks: [{ plugin: 'calendly' }, { html: 'calendly' }],
  options: {
    name: 'Calendly Options',
    isShown: {
      props: {
        'data-calendly-url': true,
      },
    },
    fields: [
      {
        name: 'Calendly Url',
        propsName: 'data-calendly-url',
        type: 'TextOption',
      },
    ],
  },
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages