nuxt-canonical

Module for automatically generating canonical tags for all pages in your nuxt project
4,953 19
Install
npm install nuxt-canonical
Latest Version:1.0.6
License:GPL-3.0-or-later
Last Updated:May 7, 2023
Links: GitHub  ·  npm
Maintainer: notholst

nuxt-canonical

This package allows you to have canonicaltags automatically generated when generating static sites with nuxt. This helps you avoid SEO crawlers marking your non-www urls as duplicates, by telling them which of the two base urls is the "correct" one.

Usage

nuxt.config.js

...

modules: [
    ['nuxt-canonical', { baseUrl: 'https://my-non-www-base-url.io' }],
]

This will result in the following tag being inserted into all generated pages:

<link rel="canonical" href="https://my-non-www-base-url.io/{{pageName}}" />

Options

Available options besides the required baseUrl

{
  trailingSlashes: true, // Adds trailing slashes to the href attribute urls, defaults to true
  forceLowercase: false // Forces lowercase href attribute urls, defaults to false
}

Related Packages

@ranklint/devtools

Nuxt DevTools panel for ranklint: live SEO checks of the current page.

1,893 2
@nuxtjs/redirect-module

Nuxt module to dynamically redirect initial requests

248,427 307
@braid/nuxt-drupal-jsonapi

A nuxt module for interfacing directly with the output of Drupal's native JSON:A...

1,342 6
ranklint

Lint your SEO before Google does. Alias for @ranklint/cli: the SEO linter for CI...

1,671 2
nuxt-mapple

Nuxt Mapple: Sitemap Generator

538 9

Version History

Version Released License
1.0.6 GPL-3.0-or-later
1.0.5 GPL-3.0-or-later
1.0.4 GPL-3.0-or-later
1.0.3 GPL-3.0-or-later
1.0.2 GPL-3.0-or-later