add opengraph stuff

This commit is contained in:
biglyderv 2024-11-25 14:12:44 -05:00
parent 42aaebbd69
commit bde68d3797
14 changed files with 29 additions and 18 deletions

View file

@ -7,7 +7,6 @@ let db = await initDb();
let main = new Route([auth], async function (req, res, input) {
let {route} = req.params;
let {id} = req.query;
let { username } = input;
let comments = await db.all('SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC', [
route,

View file

@ -2,9 +2,8 @@ import Route from "../route.js";
import auth from "../form/auth.js";
let main = new Route([auth], async function (req, res, input) {
let { username } = input;
return res.render('404', {
username
...input
});
});

View file

@ -3,7 +3,6 @@ import auth from "../form/auth.js";
// TODO: rewrite
let main = new Route([auth], async function (req, res, input) {
let { username } = input;
return res.render('form', {
data: [
{ label: "Username", type: "text", name: "user" },
@ -11,7 +10,7 @@ let main = new Route([auth], async function (req, res, input) {
],
'route': '/api/form/login?redirect=' + req.query.redirect,
'title': 'Login',
username
...input
});
});

View file

@ -12,7 +12,7 @@ let main = new Route([auth], async function (req, res, input) {
username
]);
return res.render('main', {
username,
...input,
videos,
videosFollow
});

View file

@ -12,7 +12,8 @@ let main = new Route([comment], async function (req, res, input) {
videoData = videoData[0];
return res.render('player', {
...input,
videoData
videoData,
ogType: 'video'
});
});

View file

@ -3,7 +3,6 @@ import auth from "../form/auth.js";
// TODO: rewrite
let main = new Route([auth], async function (req, res, input) {
let { username } = input;
return res.render('form', {
data: [
{ label: "Description", type: "textarea", name: "desc" },
@ -11,7 +10,7 @@ let main = new Route([auth], async function (req, res, input) {
],
'route': '/api/upload/settings',
'title': 'User Settings',
username
...input
}); /* todo: form in not a file */
});

View file

@ -2,9 +2,8 @@ import Route from "../route.js";
import auth from "../form/auth.js";
let main = new Route([auth], async function (req, res, input) {
let { username } = input;
return res.render('guidelines', {
username
...input
});
});

View file

@ -3,7 +3,6 @@ import auth from "../form/auth.js";
// TODO: rewrite
let main = new Route([auth], async function (req, res, input) {
let { username } = input;
return res.render('form', {
data: [
{ label: "Video file", type: "file", name: "file" },
@ -12,7 +11,7 @@ let main = new Route([auth], async function (req, res, input) {
],
'route': '/api/upload/upload',
'title': 'Upload Content',
username
...input
});
});

View file

@ -28,7 +28,8 @@ let main = new Route([comment], async function (req, res, input) {
videos,
followers,
following,
user
user,
icon: `${process.env.URL}/pfp/${id}.png`
});
});