Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-canonical-ogurl

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-canonical-ogurl

A Nuxt module to automatically generate canonical and og:url meta tags

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-91.67%
Maintainers
1
Weekly downloads
 
Created
Source

nuxt-canonical-ogurl

A Nuxt module to automatically generate canonical and og:url meta tags

Set up

  1. Add nuxt-canonical-ogurl to the dependency in your project
$ npm install nuxt-canonical-ogurl

or

$ yarn add nuxt-canonical-ogurl
  1. Add nuxt-canonical-ogurl to buildModules in nuxt.config.js, then configure options
export default {
  // ...
  buildModules: [
    "nuxt-canonical-ogurl",
  ],
  canonicalOgUrl: {
    baseURL: "https://example.com",
  },
  // You need to set router.trailingSlash true or false to use this module
  router: {
    trailingSlash: true,
  },
}

To complete set up nuxt-canonical-ogurl, you need to set router.trailingSlash. If you set router.trailingSlash: true, trailing slashes are added to the canonical URLs. (e.g. https://example.com/foo/) If you set router.trailingSlash: false, trailing slashes are stripped from the canonical URLs. (e.g. https://example.com/foo) If you don't set router.trailingSlash, nuxt-canonical-ogurl raises an error.

Options

export default {
  // ...
  canonicalOgUrl: {
    baseURL: "https://example.com",
  },
}

baseURL

type: String

Base URL for canonical tags. If you set baseURL: "https://example.com", canonical URL for pages/foo.vue would be "https://example.com/foo/" (in case router.trailingSlash: true).

License

MIT

Keywords

FAQs

Package last updated on 26 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc