diff options
Diffstat (limited to 'cgithub/src')
| -rw-r--r-- | cgithub/src/app.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cgithub/src/app.ts b/cgithub/src/app.ts index e34c7b1..5bed45d 100644 --- a/cgithub/src/app.ts +++ b/cgithub/src/app.ts @@ -44,7 +44,10 @@ export function createApp(eta: Eta) { return c.html(eta.render("error.eta", { message: "" + e })); } } - return c.html(eta.render(template, data)); + // Our URLs mirror GitHub's, so the page we scraped is the same path there. + const { pathname, search } = new URL(c.req.url); + const githubUrl = `https://github.com${pathname}${search}`; + return c.html(eta.render(template, { ...data, githubUrl })); } // For fragments fetched asynchronously by client-side JS (see public/static/refs.js): |
