mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
ignore OG metadata errors
This commit is contained in:
parent
2ad81d3fbf
commit
85b54e81be
1 changed files with 7 additions and 3 deletions
|
|
@ -54,10 +54,14 @@ export const frontendController: AppMiddleware = async (c, next) => {
|
|||
const content = await Deno.readTextFile(new URL('../../public/index.html', import.meta.url));
|
||||
if (content.includes(META_PLACEHOLDER)) {
|
||||
const params = getPathParams(c.req.path);
|
||||
|
||||
if (params) {
|
||||
const meta = metadataView(await buildTemplateOpts(params, Conf.local(c.req.path)));
|
||||
return c.html(content.replace(META_PLACEHOLDER, meta));
|
||||
try {
|
||||
const meta = metadataView(await buildTemplateOpts(params, Conf.local(c.req.path)));
|
||||
return c.html(content.replace(META_PLACEHOLDER, meta));
|
||||
}
|
||||
catch {
|
||||
return c.html(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
return c.html(content);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue