13e7dbeb52ed

show the running Kepr version on the docs page (v3.1.3)

time
2026-10-05 13:16 UTC · 1 week ago
machine
Junes-MacBook-Pro.local
agent
gpt-6.1-sol
session
clear kepr introduction
parent
ff4ae973f9fc
3 files package.json+1 −1src/pages/docs.ts+11 −1tests/front.test.ts+8 −0
package.json+1 −1
@@ -1,6 +1,6 @@11 {22 	"name": "kepr",3-	"version": "3.1.2",3+	"version": "3.1.3",44 	"private": true,55 	"type": "module",66 	"scripts": {

view file

src/pages/docs.ts+11 −1
@@ -9,6 +9,9 @@99 import { renderParagraph, renderSiteMarkdown } from "./markdown.ts";1010 1111 const SITE_DIR = join(import.meta.dir, "../../docs/site");12+const { version } = (await Bun.file(`${import.meta.dir}/../../package.json`).json()) as {13+	version: string;14+};1215 1316 /**1417  * §21.10: `/docs` is a Markdown file in Kepr's repo, rendered once at startup. `/support` is the@@ -20,7 +23,14 @@2023 	const docsBody = sitePage(docs, true);2124 	app.get("/docs", (c) => {2225 		cacheFor(c, false);23-		return c.html(page(ctx, { title: "docs", path: "/docs", ...docsBody }));26+		return c.html(27+			page(ctx, {28+				title: "docs",29+				path: "/docs",30+				...docsBody,31+				body: html`<p class="mono muted">Running Kepr v${version}</p>${docsBody.body}`,32+			}),33+		);2434 	});2535 	app.get("/support", (c) => {2636 		if (setting(ctx.kepr, "support_off")) return notFound(c, ctx);

view file

tests/front.test.ts+8 −0
@@ -230,6 +230,14 @@230230 });231231 232232 describe("docs and support", () => {233+	test("docs show the running Kepr version", async () => {234+		const { version } = (await Bun.file(join(import.meta.dir, "../package.json")).json()) as {235+			version: string;236+		};237+		expect(await body("/docs")).toContain(`<p class="mono muted">Running Kepr v${version}</p>`);238+		expect(await body("/support")).not.toContain("Running Kepr v");239+	});240+233241 	test("render the repo's Markdown, links left as written", async () => {234242 		const docs = await body("/docs");235243 		expect(docs).toContain("<h1>Your work, in public</h1>");

view file