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