Skip to content

littlegiants/nuxt-canonical

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •