mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-18 02:20:49 +01:00
Merge branch 'master' into webpack5
This commit is contained in:
@@ -107,7 +107,7 @@
|
||||
"passport-local": "1.0.0",
|
||||
"pg": "8.7.3",
|
||||
"pg-cursor": "2.7.3",
|
||||
"postcss": "8.4.7",
|
||||
"postcss": "8.4.8",
|
||||
"postcss-clean": "1.2.0",
|
||||
"prompt": "1.2.2",
|
||||
"ioredis": "4.28.5",
|
||||
|
||||
@@ -269,11 +269,15 @@ async function addTags(topicData, req, res) {
|
||||
async function addOGImageTags(res, topicData, postAtIndex) {
|
||||
const uploads = postAtIndex ? await posts.uploads.listWithSizes(postAtIndex.pid) : [];
|
||||
const images = uploads.map((upload) => {
|
||||
upload.name = `${url + upload_url}/files/${upload.name}`;
|
||||
upload.name = `${url + upload_url}/${upload.name}`;
|
||||
return upload;
|
||||
});
|
||||
if (topicData.thumbs) {
|
||||
images.push(...topicData.thumbs.map(thumbObj => ({ name: nconf.get('url') + thumbObj.url })));
|
||||
const path = require('path');
|
||||
const thumbs = topicData.thumbs.filter(
|
||||
t => t && images.every(img => path.normalize(img.name) !== path.normalize(url + t.url))
|
||||
);
|
||||
images.push(...thumbs.map(thumbObj => ({ name: url + thumbObj.url })));
|
||||
}
|
||||
if (topicData.category.backgroundImage && (!postAtIndex || !postAtIndex.index)) {
|
||||
images.push(topicData.category.backgroundImage);
|
||||
|
||||
Reference in New Issue
Block a user