1.0.1 • Published 5 years ago

@quanzo/metaparam v1.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

npm.io

Meta tags tool

Provides page meta tags for the CodeX Editor. Block has title, description and keywords.

Installation

Install via NPM

Get the package

npm i --save-dev @quanzo/metaparam

Include module at your application

const Metaparam = require('@quanzo/metaparam');

Download to your project's source dir

  1. Upload folder dist from repository
  2. Add dist/editor.metaparam.js file to your page.

Load from CDN

You can load specific version of package from jsDelivr CDN.

https://cdn.jsdelivr.net/npm/@quanzo/metaparam@latest

Then require this script on page with CodeX Editor.

<script src="..."></script>

Usage

Add a new Tool to the tools property of the CodeX Editor initial config.

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    metaparam: Metaparam,
  },
  
  ...
});

Or init Metaparam Tool with additional settings

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    metaparam: {
      class: Metaparam,
      config: {
        titlePlaceholder: 'Title',
        descriptionPlaceholder: 'Description',
		    keywordsPlaceholder: 'Keywords',
      },
    },
  },
  
  ...
});

Output data

FieldTypeDescription
titlestringtitle
descriptionstringdescription
keywordsstringkeywords
{
    "type" : "metaparam",
    "data" : {
        "title" : "Page title",
        "description" : "Avoid using this method just for lulz. It can be very dangerous opposite your daily fun stuff.",
		    "keywords" : "keywords"
    }
}