Nuxt Jsonld

screenshot of Nuxt Jsonld
nuxt
vue

A Nuxt.js module to manage JSON-LD in Vue component.

Overview

The nuxt-jsonld module is a Nuxt.js module designed to manage JSON-LD in Vue components. It allows users to easily incorporate structured data into their websites. This module is compatible with Nuxt2 and provides functionality for both the Composition API and Options API.

Features

  • Installation: Install the nuxt-jsonld module to begin using it in your Nuxt.js project.
  • Usage: Call the useJsonld function with a json object or pass a function for reactive json. This module is auto-imported by Nuxt.js and can be used without importing explicitly.
  • Composition API: Use the useJsonld function in your Vue components and return a structured data object.
  • Options API: The jsonld method is implemented using a global mixin. It can be disabled if not needed.
  • Tips: Hide JSON-LD tags by returning null. Return multiple JSON data as an array or use @graph notation. However, note that Safari may log an error when using an array to describe multiple data. To avoid this issue, use @graph.

Summary

The nuxt-jsonld module is a useful tool for managing JSON-LD in Vue components in a Nuxt.js project. It offers easy installation, usage with both the Composition API and Options API, and helpful tips for working with JSON-LD tags.

nuxt
Nuxt

nuxt.js is a lightweight and flexible JavaScript framework that allows developers to easily build dynamic and reactive user interfaces. Its intuitive syntax, modular architecture, and focus on performance make it a popular choice for modern web development.

vue
Vue

Vue.js is a lightweight and flexible JavaScript framework that allows developers to easily build dynamic and reactive user interfaces. Its intuitive syntax, modular architecture, and focus on performance make it a popular choice for modern web development.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.