Permalink
Browse files

feat(meta): add author property (#41)

  • Loading branch information...
manniL authored and pi0 committed Mar 8, 2018
1 parent 6481d2b commit cafcfc40eb020a03c0f39d2a121c4f1a54e915b6
Showing with 10 additions and 0 deletions.
  1. +4 −0 docs/modules/meta.md
  2. +6 −0 packages/meta/index.js
@@ -47,6 +47,10 @@ Please read this resources before you enable `mobileAppIOS` option:
- Default: *npm_package_name*
- Meta: `title`
**author**
- Default: *npm_package_author_name*
- Meta: `author`
**description**
- Default: *npm_package_description*
- Meta: `description`
@@ -19,6 +19,7 @@ function generateMeta (_options) {
// Defaults
const defaults = {
name: process.env.npm_package_name,
author: process.env.npm_package_author_name,
description: process.env.npm_package_description,
charset: 'utf-8',
viewport: undefined,
@@ -103,6 +104,11 @@ function generateMeta (_options) {
this.options.head.meta.push({ hid: 'apple-mobile-web-app-title', name: 'apple-mobile-web-app-title', content: title })
}
// 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
if (options.description && !find(this.options.head.meta, 'name', 'description')) {
this.options.head.meta.push({ hid: 'description', name: 'description', content: options.description })

0 comments on commit cafcfc4

Please sign in to comment.