Skip to content

ChromaticHQ/eleventy-plugin-schema

This branch is 47 commits behind quasibit/eleventy-plugin-schema:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

71db5dc · Mar 22, 2022

History

78 Commits
Dec 30, 2021
Feb 18, 2022
Mar 22, 2022
Feb 26, 2022
Jan 8, 2022
Jul 3, 2020
Jul 3, 2020
Jul 3, 2020
Jul 3, 2020
Jul 3, 2020
Feb 26, 2022
Jul 3, 2020
Feb 18, 2022
Jul 3, 2020
Feb 26, 2022
Feb 26, 2022

Repository files navigation

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 a shortcode to generate the JSON-LD script (including the <script> tag).

The shortcode supports 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 %}

Validation

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

Related plugins

Maintainers

Special thanks to @christopherpickering.

License

MIT. See LICENSE.

About

Eleventy plugin to generate JSON-LD structured data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%