Skip to content

Commit

Permalink
Merge 65757c9 into 3176fe0
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Aug 15, 2019
2 parents 3176fe0 + 65757c9 commit e21f643
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 0 additions & 4 deletions lib/plugins/helper/open_graph.js
Expand Up @@ -116,10 +116,6 @@ function openGraphHelper(options = {}) {
}

result += meta('twitter:card', twitterCard);
result += meta('twitter:title', title);
if (description) {
result += meta('twitter:description', description, false);
}

if (images.length) {
result += meta('twitter:image', images[0], false);
Expand Down
6 changes: 2 additions & 4 deletions test/scripts/helpers/open_graph.js
Expand Up @@ -36,8 +36,7 @@ describe('open_graph', () => {
meta({property: 'og:url'}),
meta({property: 'og:site_name', content: hexo.config.title}),
meta({property: 'og:updated_time', content: post.updated.toISOString()}),
meta({name: 'twitter:card', content: 'summary'}),
meta({name: 'twitter:title', content: hexo.config.title})
meta({name: 'twitter:card', content: 'summary'})
].join('\n'));

return Post.removeById(post._id);
Expand Down Expand Up @@ -424,15 +423,14 @@ describe('open_graph', () => {
result.should.not.contain(meta({property: 'og:updated_time', content: '2016-05-23T21:20:21.372Z'}));
});

it('description - do not add /(?:og:|twitter:)?description/ meta tags if there is no description', () => {
it('description - do not add /(?:og:)?description/ meta tags if there is no description', () => {
const result = openGraph.call({
page: { },
config: {},
is_post: isPost
}, { });

result.should.not.contain(meta({property: 'og:description'}));
result.should.not.contain(meta({property: 'twitter:description'}));
result.should.not.contain(meta({property: 'description'}));
});

Expand Down

0 comments on commit e21f643

Please sign in to comment.