fix: missing postAtIndex handling

This commit is contained in:
Julian Lam
2023-02-24 14:23:42 -05:00
parent 4cf04f06f6
commit e6d7e55fbc

View File

@@ -249,10 +249,6 @@ async function addTags(topicData, req, res) {
rel: 'canonical',
href: `${url}/topic/${topicData.slug}`,
},
{
rel: 'author',
href: `${url}/user/${postAtIndex.user.userslug}`,
},
];
if (!topicData['feeds:disableRSS']) {
@@ -269,6 +265,13 @@ async function addTags(topicData, req, res) {
href: `${url}/category/${topicData.category.slug}`,
});
}
if (postAtIndex) {
res.locals.linkTags.push({
rel: 'author',
href: `${url}/user/${postAtIndex.user.userslug}`,
});
}
}
async function addOGImageTags(res, topicData, postAtIndex) {