Skip to content

AvensioDev/nuxt-jsonld

Repository files navigation

@avensio/nuxt-jsonld

npm version npm downloads Documentation GitHub License

Documentation · GitHub

Build a single route-aware Schema.org JSON-LD graph in Nuxt.

Features

  • Register structured data with an auto-imported useJsonLd composable.
  • Combine application-wide and route-specific objects in one head script.
  • Deduplicate and replace typed objects by their @id.
  • Create typed Schema.org objects with package exports for creators and classes.
  • Reuse type, object, and bundle presets stored in your Nuxt project.

Installation

Requires Nuxt 3.0 or newer and Node.js 18.12 or newer.

nuxi module add @avensio/nuxt-jsonld

Usage

<script setup lang="ts">
import { createOrganization } from '@avensio/nuxt-jsonld/creators'

useJsonLd(
  createOrganization({
    '@id': 'https://example.com/#organization',
    name: 'Example Inc.',
    url: 'https://example.com/',
  })
)
</script>

The module combines application-wide and route-specific objects in one application/ld+json graph.

Documentation

Contributing and security

See the contribution guide for development and verification steps. Report vulnerabilities according to the security policy.

License

MIT

About

Nuxt module for building one route-aware Schema.org JSON-LD graph. Register global and page data with useJsonLd, deduplicate nodes by @id, use generated types and creators, apply presets, and render a single SSR-friendly head script.

Topics

Resources

License

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors