mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
fixed user picture in og:image
This commit is contained in:
@@ -71,6 +71,11 @@ topicsController.get = function(req, res, next) {
|
|||||||
ogImageUrl = nconf.get('url') + ogImageUrl;
|
ogImageUrl = nconf.get('url') + ogImageUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var userPicture = '';
|
||||||
|
if (topicData.posts.length && topicData.posts[0].user) {
|
||||||
|
userPicture = topicData.posts[0].user.picture;
|
||||||
|
}
|
||||||
|
|
||||||
res.locals.metaTags = [
|
res.locals.metaTags = [
|
||||||
{
|
{
|
||||||
name: "title",
|
name: "title",
|
||||||
@@ -102,7 +107,7 @@ topicsController.get = function(req, res, next) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
property: 'og:image',
|
property: 'og:image',
|
||||||
content: topicData.posts.length?topicData.posts[0].picture:''
|
content: userPicture
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
property: "article:published_time",
|
property: "article:published_time",
|
||||||
|
|||||||
Reference in New Issue
Block a user