1.11.0 • Published 1 year ago

@quasibit/eleventy-plugin-schema v1.11.0

Weekly downloads
10
License
MIT
Repository
github
Last release
1 year ago

eleventy-plugin-schema

npm Release workflow Test workflow codecov semantic-release Commitizen friendly License: MIT

Eleventy plugin to generate JSON-LD structured data.

Installation

Install the package:

npm install --save @quasibit/eleventy-plugin-schema

Add the plugin to your Eleventy configuration (usually .eleventy.js):

const schema = require("@quasibit/eleventy-plugin-schema");

module.exports = function(eleventyConfig) {
  eleventyConfig.addPlugin(schema);
};

Introduction

The plugin adds two shortcodes to generate the JSON-LD script:

  • jsonLdScript (includes the <script> tag)
  • jsonLd (just JSON-LD without the <script> tag)

The shortcodes support the following schema types:

Usage

Add data/front matter to your pages. Please refer to the files in demo. If you already have the value in other properties, you can use computed data to clone them.

Call the shortcode where you want the script to be displayed:

{% jsonLdScript meta, type, tags %}

And if you don't want the <script> tag, then use this instead:

{% jsonLd meta, type, tags %}

Validation

You can validate the structured data using one of the following tools:

Related plugins

Maintainers

Special thanks to @christopherpickering.

License

MIT. See LICENSE.

1.11.0

1 year ago

1.10.1

1 year ago

1.10.0

2 years ago

1.9.1

2 years ago

1.2.0

2 years ago

1.9.0

2 years ago

1.8.0

2 years ago

1.7.0

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.1.0

2 years ago

1.0.0

4 years ago