diff --git a/ogp.js b/ogp.js index 92738aa..88d565d 100644 --- a/ogp.js +++ b/ogp.js @@ -12,6 +12,7 @@ class OpenGraph { size; title = ''; + description = ''; author = ''; color = ''; showSize = false; @@ -31,6 +32,11 @@ class OpenGraph { return this; } + setDescription(description) { + this.description = description; + return this; + } + setAuthor(author) { this.author = author; return this; @@ -60,12 +66,11 @@ class OpenGraph { }; view.title = (this.title.length != 0) ? `` : ''; + view.description = (this.description.length != 0) ? `` : ''; view.site = (this.author.length != 0) ? `` : ''; view.color = (this.color.length != 0) ? `` : ''; view.card = !this.type.includes('video') ? `` : ''; - //todo: og:description - return Mustache.render(html, view); } } @@ -77,6 +82,7 @@ const html = ` {{{title}}} + {{{description}}} {{{site}}} {{{color}}} {{{card}}}