nuxt-i18n
Advanced tools
Comparing version 2.1.1 to 2.2.0
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="2.2.0"></a> | ||
# [2.2.0](https://github.com/paulgv/nuxt-i18n/compare/v2.1.1...v2.2.0) (2018-02-10) | ||
### Features | ||
* Generate pages SEO metadata ([dfb8432](https://github.com/paulgv/nuxt-i18n/commit/dfb8432)) | ||
<a name="2.1.1"></a> | ||
@@ -7,0 +17,0 @@ ## [2.1.1](https://github.com/paulgv/nuxt-i18n/compare/v2.1.0...v2.1.1) (2018-02-08) |
@@ -8,3 +8,4 @@ const { resolve } = require('path') | ||
const defaults = { | ||
noPrefixDefaultLocale: true | ||
noPrefixDefaultLocale: true, | ||
seo: true | ||
} | ||
@@ -41,2 +42,11 @@ const options = merge(defaults, moduleOptions, this.options.i18n) | ||
// SEO plugin | ||
if (options.seo) { | ||
this.addPlugin({ | ||
src: resolve(__dirname, './templates/i18n.seo.plugin.js'), | ||
fileName: 'i18n.seo.plugin.js', | ||
options | ||
}) | ||
} | ||
// Middleware | ||
@@ -43,0 +53,0 @@ this.addTemplate({ |
{ | ||
"name": "nuxt-i18n", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"description": "i18n for Nuxt", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -176,2 +176,13 @@ # nuxt-i18n | ||
### SEO | ||
By default, **nuxt-i18n** adds some metadata to help with your pages SEO. This can be disabled by setting `seo` option to `false`. | ||
Here's what it does: | ||
- Add a *lang* attribute containing the current locale's ISO code to the `<html>` tag. | ||
- Generate `<link rel="alternate" hreflang="x">` tags for every language configured in `nuxt.config.js`. For each language, the ISO code is used as `hreflang` attribute's value. | ||
To customize SEO metadata for any page, simply declare your own `head ()` method, have a look at [lib/templates/i18n.seo.plugin.js](lib/templates/i18n.seo.plugin.js) if you want to copy some of **nuxt-i18n**'s logic. | ||
## Options | ||
@@ -178,0 +189,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22256
10
253
264