Show both books on About with matching covers and downloads.

The section mixed Structure Before Crisis art with the Community Rules booklet; pairing each title to its own cover and PDF, and cropping the Figma cover padding, keeps the two cards consistent.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-08-25 16:18:40 -06:00
co-authored by Cursor
parent 8bdd5040c6
commit 63e0f77998
13 changed files with 155 additions and 43 deletions
+14 -11
View File
@@ -1,18 +1,21 @@
import { existsSync, readFileSync } from "node:fs";
import { readFileSync } from "node:fs";
import { join } from "node:path";
import { describe, expect, it } from "vitest";
import { getAssetPath, governanceBookletPath } from "../../../lib/assetUtils";
import {
governanceBookletPath,
structureBeforeCrisisPath,
} from "../../../lib/assetUtils";
describe("governance booklet", () => {
it("ships a PDF at the About Book download path", () => {
const relative = governanceBookletPath();
expect(relative).toBe("assets/marketing/governance-booklet.pdf");
expect(getAssetPath(relative)).toBe("/assets/marketing/governance-booklet.pdf");
const publicRoot = join(process.cwd(), "public");
const abs = join(process.cwd(), "public", relative);
expect(existsSync(abs)).toBe(true);
function assertPdf(relativePath: string) {
const bytes = readFileSync(join(publicRoot, relativePath));
expect(bytes.subarray(0, 5).toString("ascii")).toBe("%PDF-");
}
const header = readFileSync(abs).subarray(0, 5).toString("latin1");
expect(header).toBe("%PDF-");
describe("marketing book PDFs", () => {
it("ships both About book downloads as PDFs", () => {
assertPdf(governanceBookletPath());
assertPdf(structureBeforeCrisisPath());
});
});