diff --git a/config/filters.js b/config/filters.js index 2b5c17f7..62bd5989 100644 --- a/config/filters.js +++ b/config/filters.js @@ -15,11 +15,8 @@ module.exports = { mdToHtml: (content) => { return marked.parse(content) }, - getPostImage: (post) => { - if (post && post['image'] && post['image'] !== '') { - return post['image'] - } - + getPostImage: (image) => { + if (image && image !== '') return image return '/assets/img/social-card.png' }, webmentionsByUrl: (webmentions, url) => { diff --git a/src/_includes/base.liquid b/src/_includes/base.liquid index 7f163229..0f2ace9f 100644 --- a/src/_includes/base.liquid +++ b/src/_includes/base.liquid @@ -1,5 +1,5 @@ +{%- capture fullUrl %}{{ site.url }}{{ page.url }}{% endcapture -%} - @@ -9,13 +9,13 @@ {{ site.title }} - + - - + + striptags(md.render(data.post_excerpt)), url: (data) => data.url, image: { - src: '/assets/img/social-card.png', + src: (data) => data.image | getPostImage, }, author: { name: 'Cory Dransfeldt',