Permalink
Browse files

feat: ogSiteName (#50)

  • Loading branch information...
manniL authored and pi0 committed Apr 2, 2018
1 parent 2b69761 commit 0c99ab94cb8f6f06e0658f958345609f31da7748
Showing with 12 additions and 0 deletions.
  1. +4 −0 docs/modules/meta.md
  2. +8 −0 packages/meta/index.js
@@ -67,6 +67,10 @@ Please read this resources before you enable `mobileAppIOS` option:
- Default: `website`
- Meta: `og:type`
**ogSiteName**
- Default: same as options.name
- Meta: `og:site_name`
**ogTitle**
- Default: same as options.name
- Meta: `og:title`
@@ -31,6 +31,7 @@ function generateMeta (_options) {
theme_color: this.options.loading && this.options.loading.color,
lang: 'en',
ogType: 'website',
ogSiteName: true,
ogTitle: true,
ogDescription: true,
ogImage: true,
@@ -144,6 +145,13 @@ function generateMeta (_options) {
if (options.ogTitle && !find(this.options.head.meta, 'property', 'og:title') && !find(this.options.head.meta, 'name', 'og:title')) {
this.options.head.meta.push({ hid: 'og:title', name: 'og:title', property: 'og:title', content: options.ogTitle })
}
// og:site_name
if (options.ogSiteName === true) {
options.ogSiteName = options.name
}
if (options.ogSiteName && !find(this.options.head.meta, 'property', 'og:site_name') && !find(this.options.head.meta, 'name', 'og:site_name')) {
this.options.head.meta.push({ hid: 'og:site_name', name: 'og:site_name', property: 'og:site_name', content: options.ogSiteName })
}
// og:description
if (options.ogDescription === true) {

0 comments on commit 0c99ab9

Please sign in to comment.