Skip to content

Commit

Permalink
fix code style error
Browse files Browse the repository at this point in the history
  • Loading branch information
restran committed Apr 25, 2017
1 parent e3aff27 commit 800aa7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/plugins/helper/open_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function meta(name, content, escape) {
if (escape !== false) {
content = escapeHTML(content);
}

return htmlTag('meta', {
name: name,
content: content
Expand All @@ -22,6 +23,7 @@ function og(name, content, escape) {
if (escape !== false) {
content = escapeHTML(content);
}

return htmlTag('meta', {
property: name,
content: content
Expand All @@ -39,7 +41,6 @@ function openGraphHelper(options) {
var content = page.content;
var images = options.image || options.images || page.photos || [];
var description = options.description || page.description || page.excerpt || content || config.description;
// support keywords from page.keywords, page.tag or theme.keywords
var keywords = page.keywords || page.tags || theme.keywords;
var title = options.title || page.title || config.title;
var type = options.type || (this.is_post() ? 'article' : 'website');
Expand Down Expand Up @@ -77,12 +78,11 @@ function openGraphHelper(options) {
result += meta('description', description);
}

// support keywords in type of string or array
if (keywords) {
if (typeof keywords === 'string') {
result += meta('keywords', keywords);
} else if (keywords.toArray()) {
result += meta('keywords', keywords.map(function(tag) {
result += meta('keywords', keywords.map(function(tag) {
return tag.name;
}).filter(function(keyword) {
return !!keyword;
Expand Down

0 comments on commit 800aa7e

Please sign in to comment.