Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-i18n

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-i18n - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

lib/templates/i18n.seo.plugin.js

10

CHANGELOG.md

@@ -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)

12

lib/module.js

@@ -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({

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc