Public: anyone can read this; the crew can change it.
The front page's tab title reads "forge", not "forge · forge" #6056
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/6037-the-front-page-s-tab-title-reads-forge-n → main 1 commit fork 1 thread · 1 unresolved
2 files
changed +36
−1
src/web/layout.ts +1 −1
| @@ -549,7 +549,7 @@ export function page(options: PageOptions, status = 200): Response { | ||
| 549 | 549 | name="viewport" |
| 550 | 550 | content="width=device-width, initial-scale=1, viewport-fit=cover" |
| 551 | 551 | /> |
| 552 | <title>${options.title} · forge</title> | |
| 552 | <title>${options.title === "forge" ? "forge" : `${options.title} · forge`}</title> | |
| 553 | 553 | <meta name="description" content="${pageDescription(options)}" /> |
| 554 | 554 | <meta property="og:site_name" content="forge" /> |
| 555 | 555 | <meta property="og:type" content="website" /> |
test/page-title.test.ts added +35
| @@ -0,0 +1,35 @@ | ||
| 1 | /** The tab title names the forge once (#6037). */ | |
| 2 | import { afterAll, beforeAll, expect, test } from "bun:test"; | |
| 3 | import { mkdtemp, rm } from "node:fs/promises"; | |
| 4 | import { tmpdir } from "node:os"; | |
| 5 | import { join } from "node:path"; | |
| 6 | import { createApp, type App } from "../src/app.ts"; | |
| 7 | import { serve, type Servers } from "../src/http/server.ts"; | |
| 8 | ||
| 9 | let dataDir: string; | |
| 10 | let app: App; | |
| 11 | let servers: Servers; | |
| 12 | ||
| 13 | beforeAll(async () => { | |
| 14 | dataDir = await mkdtemp(join(tmpdir(), "forge-title-")); | |
| 15 | app = createApp({ dataDir, port: 0 }); | |
| 16 | servers = await serve(app); | |
| 17 | }); | |
| 18 | ||
| 19 | afterAll(async () => { | |
| 20 | servers.stop(); | |
| 21 | app.close(); | |
| 22 | await rm(dataDir, { recursive: true, force: true }); | |
| 23 | }); | |
| 24 | ||
| 25 | const page = async (path: string) => (await fetch(`${servers.url}${path}`)).text(); | |
| 26 | ||
| 27 | test("the front page is titled forge, once", async () => { | |
| 28 | const raw = await page("/"); | |
| 29 | expect(raw).toContain("<title>forge</title>"); | |
| 30 | expect(raw).toContain('property="og:title" content="forge"'); | |
| 31 | }); | |
| 32 | ||
| 33 | test("another page keeps its suffix", async () => { | |
| 34 | expect(await page("/login")).toMatch(/<title>[^<]+ · forge<\/title>/); | |
| 35 | }); |
new above
offline
/login is not a page here (preview gives "Not found · forge"); use an existing route so the assertion means something.