Skip to content

Commit

Permalink
feat(meta): add author property (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
manniL authored and pi0 committed Mar 8, 2018
1 parent 6481d2b commit cafcfc4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/modules/meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
6 changes: 6 additions & 0 deletions packages/meta/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 })
Expand Down

0 comments on commit cafcfc4

Please sign in to comment.