diff --git a/routes/app.html.tsx b/routes/app.html.tsx index f75bd3fd..32f321d3 100644 --- a/routes/app.html.tsx +++ b/routes/app.html.tsx @@ -1,7 +1,10 @@ import type { Operation } from "effection"; import type { JSXChild, JSXElement } from "revolution"; -import { useAbsoluteUrl } from "../plugins/current-request.ts"; +import { + useAbsoluteUrl, + useCurrentRequest, +} from "../plugins/current-request.ts"; import { ProjectSelect } from "../components/project-select.tsx"; const PAGE_SENSE_SCRIPT_SRC = getEnv("PAGE_SENSE_SCRIPT_SRC"); @@ -18,7 +21,9 @@ export function* useAppHtml( options: Options, ): Operation<({ children }: { children: JSXChild }) => JSXElement> { let { title, description, author } = options; - let siteURL = yield* useAbsoluteUrl("/"); + let request = yield* useCurrentRequest(); + let url = new URL(request.url); + let ogURL = yield* useAbsoluteUrl(url.pathname); let ogImageMeta = yield* useAbsoluteUrl(options.ogImage); let twitterXImageMeta = yield* useAbsoluteUrl(options.twitterXImage); let logoNoText = "/assets/fs-logo-no-text.svg"; @@ -36,7 +41,7 @@ export function* useAppHtml( {title} - + @@ -53,9 +58,9 @@ export function* useAppHtml( rel="stylesheet" /> - - - + + + {PageSenseScriptTag}