fixup: OpenGraph data generation
ci/woodpecker/push/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/push/lint-client Pipeline was successful Details
ci/woodpecker/push/lint-backend Pipeline was successful Details
ci/woodpecker/push/build Pipeline was successful Details
ci/woodpecker/push/lint-sw Pipeline was successful Details
ci/woodpecker/push/test Pipeline was successful Details

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: 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
// files, they are not used for a preview.
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;
for (const file of packedNote.files) {
if (file.type.startsWith('image/')) {

View File

@ -14,7 +14,7 @@ block desc
block og
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:title' content= title)
meta(property='og:description' content= summary)