From f247c2195ec7fa9e75c5e1b0c31c6324dd169a3d Mon Sep 17 00:00:00 2001 From: barisusakli Date: Sun, 23 Mar 2014 17:17:56 -0400 Subject: [PATCH] fixed user picture in og:image --- src/controllers/topics.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/controllers/topics.js b/src/controllers/topics.js index 779fbed20e..a793452e16 100644 --- a/src/controllers/topics.js +++ b/src/controllers/topics.js @@ -71,6 +71,11 @@ topicsController.get = function(req, res, next) { ogImageUrl = nconf.get('url') + ogImageUrl; } + var userPicture = ''; + if (topicData.posts.length && topicData.posts[0].user) { + userPicture = topicData.posts[0].user.picture; + } + res.locals.metaTags = [ { name: "title", @@ -102,7 +107,7 @@ topicsController.get = function(req, res, next) { }, { property: 'og:image', - content: topicData.posts.length?topicData.posts[0].picture:'' + content: userPicture }, { property: "article:published_time",