minor cleanup

pull/15/head
tycrek 4 years ago
parent 850a920c38
commit db1b88fb5a
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -53,7 +53,7 @@ class OpenGraph {
}
build() {
let view = {
return Mustache.render(html, {
github,
http: this.http,
@ -63,15 +63,13 @@ class OpenGraph {
ogtype: this.type.includes('video') ? 'video.other' : 'image',
type: this.type.includes('video') ? 'video' : 'image',
ext: this.type.includes('video') ? '.mp4' : '',
};
view.title = (this.title.length != 0) ? `<meta property="og:title" content="${this.title}">` : '';
view.description = (this.description.length != 0) ? `<meta property="og:description" content="${this.description}">` : '';
view.site = (this.author.length != 0) ? `<meta property="og:site_name" content="${this.author}">` : '';
view.color = (this.color.length != 0) ? `<meta name="theme-color" content="${this.color}">` : '';
view.card = !this.type.includes('video') ? `<meta name="twitter:card" content="summary_large_image">` : '';
return Mustache.render(html, view);
title: (this.title.length != 0) ? `<meta property="og:title" content="${this.title}">` : '',
description: (this.description.length != 0) ? `<meta property="og:description" content="${this.description}">` : '',
site: (this.author.length != 0) ? `<meta property="og:site_name" content="${this.author}">` : '',
color: (this.color.length != 0) ? `<meta name="theme-color" content="${this.color}">` : '',
card: !this.type.includes('video') ? `<meta name="twitter:card" content="summary_large_image">` : '',
});
}
}

Loading…
Cancel
Save