meta tags pls

This commit is contained in:
Erik 2022-03-24 01:08:31 +02:00
parent 379c178f59
commit 56918b9358
No known key found for this signature in database
GPG Key ID: FEFF4B220DDF5589
2 changed files with 9 additions and 8 deletions

View File

@ -27,9 +27,10 @@
<title>Corgi Corner</title>
<meta name='author' content='{{META_author}}' />
<meta property='og:url' content='{{META_url}}' />
<meta property='og:image' content={{META_thumbnail}} />
<!-- <meta property='og:image' content={{META_thumbnail}} /> -->
<meta property='og:video' content='{{META_url}}' />
<meta property='og:video:url' content={{META_srcUrl}} />
<meta property='og:video:type' content='text/html' />
<meta property='og:video:type' content='video/mp4' />
<meta property='og:type' content='video.other' />
</head>

View File

@ -37,12 +37,12 @@ class Home extends Endpoint {
async get(req, res) {
console.log('\n\n\nPATH', req.path, '\n\n\n');
const { path, protocol } = req;
const { path } = req;
if ((/\/media\/.+/u).test(path)) {
const title = decodeURI(path.replace('/media/', ''));
const clip = this.client.clipIndex.getByTitle(title);
const baseUrl = `${protocol}://${this.client.domain}`;
const baseUrl = `https://${this.client.domain}`;
const clientUrl = `${baseUrl}${path}`;
const thumbnailUrl = `${baseUrl}/thumbnails/${clip.thumbnail}`;
const clipUrl = `${baseUrl}/clips/${clip.filename}`;
@ -50,10 +50,10 @@ class Home extends Endpoint {
console.log(this.index);
const html = this.index.
// replace(`<title>Corgi Corner</title>`, clip.name).
replace(`{{META_author}}`, clip.uploader.tag).
replace(`{{META_url}}`, clientUrl).
replace(`{{META_thumbnail}}`, thumbnailUrl).
replace(`{{META_srcUrl}}`, clipUrl);
replace(/{{META_author}}/ug, clip.uploader.tag).
replace(/{{META_url}}/ug, clientUrl).
replace(/{{META_thumbnail}}/ug, thumbnailUrl).
replace(/{{META_srcUrl}}/ug, clipUrl);
console.log(html);
return res.send(html);
}