Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/littlegiants/nuxt-canonical

Module for automatically generating canonical tags for all pages in your nuxt project.
https://github.com/littlegiants/nuxt-canonical

Last synced: 12 days ago
JSON representation

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

Awesome Lists containing this project

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

```javascript
...

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

```

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

```html

```

## Options

Available options besides the required baseUrl

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