npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-plugin-generate-schema

v0.0.1

Published

Generate JSON LD for different collections

Downloads

51

Readme

:warning: This plugin is still in beta and new version will cause breaking changes causing schemas to be remapped. Please report any bugs to the issues tab

Strapi Generate Schema Plugin

This plugin only supports Strapi v4

A plugin to dynamically map your database to a Schema.org JSON-LD schema. When you access your collection row with a specific query parameter (i.e ?schemaOrg=true) it will add the json-ld for that data.

Installation

npm install strapi-plugin-generate-schema

or

yarn add strapi-plugin-generate-schema

Configuration

'generate-schema': {
enabled: true,
},

Usage

After installing the plugin a "generate-schema" tab will appear on the left side of the admin panel.

Here you can see a list of your visible collection types and if you click "Map Type" you will be able to map certain fields to the corresponding schema fields.

After you have mapped your fields you can add the ?schemaOrg=true query parameter to your collection row to generate the json-ld for that row.

For example if you have a blog collection type you can query /blog?schemaOrg=true and you will see the json-ld for that row.

Issues

All general issues should be submitted through the Github issue system

If you find a security issue please do not publicly post it instead send an email to [email protected] with "Generate Schema Security Issue" as the subject

Links

Currently Implemented

  • Mapping collection types to specific schemas (i.e mapping you blog collection type to an article schema type)
  • Allow mapping of relational types (i.e mapping image urls, or relation categories)
  • Only allow mapping of viewable collections
  • Efficiently parse data objects and generate the schema without ANY additional db queries (this requires you to populate all fields in that are used in schema when requesting)
  • Bind types of schema to strapiFieldTypes. i.e you can only map a string to a string and a URL to a file upload etc
  • Delete previously mapped schemas
  • map multiple schemas to a single collection type. I.e map a reciepe and a articlel schema to the same collection type
    • Schemas are stored in an array attached to each data object when returned from the API
  • New schemaOrgs are dynamically generated based on a json file
  • support nested types (i.e @type: author)

TODO

  • [ ] Somehow add support for dynamic zones however I highly doubt this is going to be feasible due to how dynamic they are.
  • [ ] Edit existing mappings (currently can only delete and remake) not sure if I will implement this because if collection type schema changes then it will be a pita to deal with. maybe a more long term feature.
  • [ ] Prevent duplicate mapping of schemas. i.e a blog collection can have 2 different mappings to the same schema]

⭐️Did you find this helpful?

If you found this plugin helpful give it a star?