fix: #7444 Re-factor handling of og:image tags (#7463)

* fix: display proper site logo or og-image with sizes in head

* fix: refactor og:image logic, #7444

- Updated logic to set additional og:image tags based on more
  factors
- logo.png fallback

* feat: save image sizes on post upload, re: #7444

* fix: awaiting addTags in topic controller

* fix: pass strings to meta tags object

* fix: sending absolute image url to meta tag

* fix: removed unneeded async and requiring sync db

* feat: upgrade to calculate image sizes for all post uploads tracked

* fix: tests
This commit is contained in:
Julian Lam
2019-03-18 12:09:10 -04:00
committed by GitHub
parent 745a9589e9
commit 697a6597f3
7 changed files with 190 additions and 59 deletions

View File

@@ -936,7 +936,7 @@ describe('Post\'s', function () {
before(function (done) {
// Create stub files for testing
['abracadabra.png', 'shazam.jpg', 'whoa.gif', 'amazeballs.jpg', 'wut.txt', 'test.bmp']
.forEach(filename => fs.closeSync(fs.openSync(path.join(__dirname, '../public/uploads/files', filename), 'w')));
.forEach(filename => fs.closeSync(fs.openSync(path.join(nconf.get('upload_path'), 'files', filename), 'w')));
topics.post({
uid: 1,
@@ -957,7 +957,7 @@ describe('Post\'s', function () {
db.sortedSetCard('post:' + pid + ':uploads', function (err, length) {
assert.ifError(err);
assert.strictEqual(2, length);
assert.strictEqual(length, 2);
done();
});
});