Socket
Socket
Sign inDemoInstall

nuxt-canonical-ogurl

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
3
decreased by-75%
Maintainers
1
Created
Weekly downloads
 

Readme

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

Last updated on 26 Feb 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc