Sip set /block canonical url

This commit is contained in:
Mononaut
2023-08-24 20:34:36 +09:00
parent eeefaa6374
commit 8bc1eaebc0
3 changed files with 7 additions and 2 deletions

View File

@@ -396,7 +396,7 @@ class Server {
try {
const data = await matchedRoute.sip.getData(matchedRoute.params);
logger.info(`sip data fetched for "${req.url}" in ${Date.now() - start}ms`);
res.render(matchedRoute.sip.template, { canonical, ogImageUrl, ogTitle, matchedRoute, data });
res.render(matchedRoute.sip.template, { canonicalHost: this.canonicalHost, canonical, ogImageUrl, ogTitle, matchedRoute, data });
logger.info(`sip returned "${req.url}" in ${Date.now() - start}ms`);
} catch (e) {
logger.err(`failed to sip ${req.url}: ` + (e instanceof Error ? e.message : `${e}`));

View File

@@ -50,6 +50,7 @@ const routes = {
return {
block,
transactions,
canonicalPath: `/block/${blockId}`,
};
}
}