nuxt-canonical
nuxt-canonical
npm i nuxt-canonical
nuxt-canonical

nuxt-canonical

Module for automatically generating canonical tags for all pages in your nuxt project.

by littlegiants

1.0.6 (see all)License:GPL-3.0-or-laterTypeScript:Not Found
npm i nuxt-canonical
Readme

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
}

Downloads/wk

604

GitHub Stars

17

LAST COMMIT

1yr ago

MAINTAINERS

1

CONTRIBUTORS

3

OPEN ISSUES

4

OPEN PRs

0
VersionTagPublished
1.0.6
latest
2yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate