diff --git a/app/o/[slug]/d/[...path]/route.ts b/app/o/[slug]/d/[...path]/route.ts
index ec3abd9..d01faaf 100644
--- a/app/o/[slug]/d/[...path]/route.ts
+++ b/app/o/[slug]/d/[...path]/route.ts
@@ -2,8 +2,10 @@ import { and, eq } from "drizzle-orm";
import { db } from "@/lib/db";
import * as schema from "@/lib/schema";
import { accessUrl, requireMember } from "@/lib/access";
+import { getDict } from "@/lib/i18n";
+import { arg, navScript, type NavLabels } from "@/lib/doc-nav";
-// Serves a document's HTML with the pensieve nav (pill + backlinks) injected.
+// Serves a document's HTML with the pensieve nav (toolbar + backlinks) injected.
export async function GET(req: Request, ctx: { params: Promise<{ slug: string; path: string[] }> }) {
const embed = new URL(req.url).searchParams.get("embed") === "1";
const { slug, path } = await ctx.params;
@@ -28,51 +30,17 @@ export async function GET(req: Request, ctx: { params: Promise<{ slug: string; p
eq(schema.document.organizationId, access.org.id), eq(schema.document.path, docPath))).limit(1);
if (!rows.length) return new Response("not found", { status: 404 });
- const nav = ``;
+ const { t } = await getDict();
+ const ui: NavLabels = {
+ workspace: access.org.name,
+ open: t.doc.openInWorkspace,
+ openHint: t.doc.openInWorkspaceHint,
+ homeHint: t.doc.workspaceHomeHint,
+ };
+ const nav = ``;
let html = rows[0].html;
// in-workspace links resolve through the org prefix
html = html.replaceAll(/href="(\/[^"#?]+?)(?:\.(?:html|md))?"/g, (_m, p) => `href="/o/${slug}/d${p}"`);
html = html.includes("