feat: Add Open Graph and Twitter meta tags, make the domain configurable, and use WebP for thumbnails.

This commit is contained in:
x
2026-01-24 23:34:38 +01:00
parent 0cc0e5aa02
commit 595118c2c8
3 changed files with 16 additions and 5 deletions

View File

@@ -173,7 +173,7 @@ export default {
success: true,
user: {
name: actitem.username,
channel: actitem.usernetwork == "Telegram" && actitem.userchannel !== "w0bm.com" ? "anonymous" : actitem.userchannel,
channel: actitem.usernetwork == "Telegram" && actitem.userchannel !== cfg.websrv.domain ? "anonymous" : actitem.userchannel,
network: actitem.usernetwork
},
item: {
@@ -182,7 +182,7 @@ export default {
long: actitem.src,
short: url.parse(actitem.src).hostname,
},
thumbnail: `${cfg.websrv.paths.thumbnails}/${actitem.id}.png`,
thumbnail: `${cfg.websrv.paths.thumbnails}/${actitem.id}.webp`,
coverart: coverart ? `${cfg.websrv.paths.coverarts}/${actitem.id}.webp` : '/s/img/music.webp',
dest: `${cfg.websrv.paths.images}/${actitem.dest}`,
mime: actitem.mime,
@@ -194,7 +194,7 @@ export default {
favorites: favorites,
tags: tags
},
title: `${actitem.id} - w0bm.com`,
title: `${actitem.id} - ${cfg.websrv.domain}`,
pagination: {
end: items[items.length - 1]?.id,
start: items[0]?.id,

View File

@@ -144,7 +144,8 @@ process.on('unhandledRejection', err => {
tpl.globals = {
lul: cfg.websrv.lul,
themes: cfg.websrv.themes,
modes: cfg.allowedModes
modes: cfg.allowedModes,
domain: cfg.websrv.domain || 'w0bm.com'
};
router.use(tpl);