Added opengraph image to posts

This commit is contained in:
Marcus Noble 2021-05-12 09:27:51 +01:00
parent ce108e696d
commit 8f13ad501d
2 changed files with 8 additions and 2 deletions

4
app.js
View File

@ -57,7 +57,9 @@ Handlebars.registerHelper("buildTitle", function(title, siteTitle){
}
return title;
});
Handlebars.registerHelper("jointags", function(tags){
return (tags || '').split(' ').join(',');
});
Metalsmith(__dirname)
.use(define({

View File

@ -9,7 +9,11 @@
<meta property="og:title" content="{{ title }}"/>
<meta property="og:description" content="{{ striptags (markdown summary) }}"/>
<meta property="og:site_name" content="{{ site.title }}"/>
<meta property="og:image" content="{{ site.url }}/images/marcus.jpg" />
<meta property="og:image" content="https://opengraph.cluster.fun/opengraph/?siteTitle=Marcus%20Noble&title={{ title }}&tags={{ jointags tags }}&image=https%3A%2F%2Fmarcusnoble.co.uk%2Fimages%2Fmarcus.jpg&twitter=Marcus_Noble_&github=AverageMarcus&website=www.MarcusNoble.co.uk&bgColor=%23ffffff&fgColor=%23263943" />
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="https://opengraph.cluster.fun/opengraph/?siteTitle=Marcus%20Noble&title={{ title }}&tags={{ jointags tags }}&image=https%3A%2F%2Fmarcusnoble.co.uk%2Fimages%2Fmarcus.jpg&twitter=Marcus_Noble_&github=AverageMarcus&website=www.MarcusNoble.co.uk&bgColor=%23ffffff&fgColor=%23263943"/>
<!-- Twitter Do Not Track -->
<meta name="twitter:dnt" content="on">