This commit is contained in:
Barış Soner Uşaklı
2017-10-10 11:26:37 -04:00
parent d37c0cfd67
commit 67ba6bb820

View File

@@ -227,6 +227,8 @@ function addTags(topicData, req, res) {
var ogImageUrl = ''; var ogImageUrl = '';
if (topicData.thumb) { if (topicData.thumb) {
ogImageUrl = topicData.thumb; ogImageUrl = topicData.thumb;
} else if (topicData.category.backgroundImage && (!postAtIndex || !postAtIndex.index)) {
ogImageUrl = topicData.category.backgroundImage;
} else if (postAtIndex && postAtIndex.user && postAtIndex.user.picture) { } else if (postAtIndex && postAtIndex.user && postAtIndex.user.picture) {
ogImageUrl = postAtIndex.user.picture; ogImageUrl = postAtIndex.user.picture;
} else if (meta.config['og:image']) { } else if (meta.config['og:image']) {