fixup: OpenGraph data generation

This is a fixup for commits 39fb7e5946 and be30e70344.
This commit is contained in:
Johann150 2023-02-04 16:44:30 +01:00
parent 28c11ca7af
commit 1adf88b090
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1
2 changed files with 2 additions and 2 deletions

View file

@ -331,7 +331,7 @@ router.get('/notes/:note', async (ctx, next) => {
// If the note has a CW (is sensitive as a whole) or any of the files is sensitive or there are no // If the note has a CW (is sensitive as a whole) or any of the files is sensitive or there are no
// files, they are not used for a preview. // files, they are not used for a preview.
let filesOpengraph = []; let filesOpengraph = [];
if (!packedNote.cw || packedNote.files.length > 0 || packedNote.files.all(file => !file.isSensitive)) { if (!packedNote.cw || packedNote.files.length > 0 || packedNote.files.every(file => !file.isSensitive)) {
let limit = 4; let limit = 4;
for (const file of packedNote.files) { for (const file of packedNote.files) {
if (file.type.startsWith('image/')) { if (file.type.startsWith('image/')) {

View file

@ -14,7 +14,7 @@ block desc
block og block og
meta(property='og:type' content='article') meta(property='og:type' content='article')
meta(property='og:article:published_time' content=note.createdAt.toISOString()) meta(property='og:article:published_time' content=note.createdAt)
meta(property='og:article:author:username' content=user.username) meta(property='og:article:author:username' content=user.username)
meta(property='og:title' content= title) meta(property='og:title' content= title)
meta(property='og:description' content= summary) meta(property='og:description' content= summary)