@nuxtjs/meta
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -6,2 +6,16 @@ # Change Log | ||
<a name="2.2.0"></a> | ||
# [2.2.0](https://github.com/nuxt-community/pwa-module/compare/@nuxtjs/meta@2.1.0...@nuxtjs/meta@2.2.0) (2018-03-08) | ||
### Features | ||
* **meta:** add author property ([#41](https://github.com/nuxt-community/pwa-module/issues/41)) ([cafcfc4](https://github.com/nuxt-community/pwa-module/commit/cafcfc4)) | ||
* **meta:** add ogUrl url property ([#42](https://github.com/nuxt-community/pwa-module/issues/42)) ([3990ddf](https://github.com/nuxt-community/pwa-module/commit/3990ddf)) | ||
* **meta:** add twitter card, site and creator properties ([#43](https://github.com/nuxt-community/pwa-module/issues/43)) ([fe11c76](https://github.com/nuxt-community/pwa-module/commit/fe11c76)) | ||
<a name="2.1.0"></a> | ||
@@ -8,0 +22,0 @@ # [2.1.0](https://github.com/nuxt-community/pwa-module/compare/@nuxtjs/meta@2.0.2...@nuxtjs/meta@2.1.0) (2018-03-05) |
36
index.js
@@ -22,2 +22,3 @@ const debug = require('debug')('nuxt:pwa') | ||
name: process.env.npm_package_name, | ||
author: process.env.npm_package_author_name, | ||
description: process.env.npm_package_description, | ||
@@ -36,3 +37,8 @@ charset: 'utf-8', | ||
ogDescription: true, | ||
ogImage: true | ||
ogImage: true, | ||
ogHost: undefined, | ||
ogUrl: true, | ||
twitterCard: undefined, | ||
twitterSite: undefined, | ||
twitterCreator: undefined | ||
} | ||
@@ -108,2 +114,7 @@ | ||
// Author | ||
if (options.author && !find(this.options.head.meta, 'name', 'author')) { | ||
this.options.head.meta.push({ hid: 'author', name: 'author', content: options.author }) | ||
} | ||
// description meta | ||
@@ -148,2 +159,10 @@ if (options.description && !find(this.options.head.meta, 'name', 'description')) { | ||
// og:url | ||
if (options.ogHost && options.ogUrl === true) { | ||
options.ogUrl = options.ogHost | ||
} | ||
if (options.ogUrl && !find(this.options.head.meta, 'property', 'og:url') && !find(this.options.head.meta, 'name', 'og:url')) { | ||
this.options.head.meta.push({hid: 'og:url', name: 'og:url', property: 'og:url', content: options.ogUrl}) | ||
} | ||
// og:image | ||
@@ -195,4 +214,19 @@ if (options.ogImage === true) { | ||
} | ||
// twitter:card | ||
if (options.twitterCard && !find(this.options.head.meta, 'property', 'twitter:card') && !find(this.options.head.meta, 'name', 'twitter:card')) { | ||
this.options.head.meta.push({ hid: 'twitter:card', name: 'twitter:card', property: 'twitter:card', content: options.twitterCard }) | ||
} | ||
// twitter:site | ||
if (options.twitterSite && !find(this.options.head.meta, 'property', 'twitter:site') && !find(this.options.head.meta, 'name', 'twitter:site')) { | ||
this.options.head.meta.push({ hid: 'twitter:site', name: 'twitter:site', property: 'twitter:site', content: options.twitterSite }) | ||
} | ||
// twitter:creator | ||
if (options.twitterCreator && !find(this.options.head.meta, 'property', 'twitter:creator') && !find(this.options.head.meta, 'name', 'twitter:creator')) { | ||
this.options.head.meta.push({ hid: 'twitter:creator', name: 'twitter:creator', property: 'twitter:creator', content: options.twitterCreator }) | ||
} | ||
} | ||
module.exports.meta = require('./package.json') |
{ | ||
"name": "@nuxtjs/meta", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
14354
195
4