From ee4e7ae11adead8810a17fd63759cdee88120cc7 Mon Sep 17 00:00:00 2001
From: Cursor Agent
Date: Mon, 3 Aug 2026 19:36:15 +0000
Subject: [PATCH] Add ebook download links to the site's book page
Link PDF/EPUB/FB2/HTML from /book/ to the GitHub release assets that
release-on-merge.yml attaches on every merge to main, via the stable
releases/latest/download URLs. MOBI is not linked because the build
does not actually produce it.
Co-authored-by: Scott Chacon
---
site/src/pages/book/index.astro | 39 +++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/site/src/pages/book/index.astro b/site/src/pages/book/index.astro
index 567e412..abd6f78 100644
--- a/site/src/pages/book/index.astro
+++ b/site/src/pages/book/index.astro
@@ -2,6 +2,16 @@
import Base from '../../layouts/Base.astro';
import { url } from '../../lib/url';
import book from '../../generated/book.json';
+
+// Ebook files are attached to a GitHub release on every merge to main
+// (see .github/workflows/release-on-merge.yml); "latest" always points there.
+const downloadBase = 'https://github.com/progit/progit3/releases/latest/download';
+const downloads = [
+ { label: 'PDF', file: 'progit.pdf' },
+ { label: 'EPUB', file: 'progit.epub' },
+ { label: 'FB2', file: 'progit.fb2.zip' },
+ { label: 'HTML', file: 'progit.html' },
+];
---
@@ -14,6 +24,12 @@ import book from '../../generated/book.json';
Read the whole book right here, one section at a time — or
search it for what you need.
+
+ Download:
+ {downloads.map((d) => (
+ {d.label}
+ ))}
+
Built from the sources · rev {book.revnumber} · {book.revdate}
@@ -63,6 +79,29 @@ import book from '../../generated/book.json';
margin: 0 0 0.6rem;
}
+ .downloads {
+ color: var(--muted);
+ font-size: 0.95rem;
+ margin: 0 0 0.6rem;
+ }
+
+ .downloads a {
+ display: inline-block;
+ margin-left: 0.35rem;
+ padding: 0.1rem 0.6rem;
+ border: 1px solid var(--border);
+ border-radius: 999px;
+ color: var(--accent);
+ font-size: 0.85rem;
+ text-decoration: none;
+ }
+
+ .downloads a:hover {
+ background: var(--accent);
+ color: var(--bg);
+ border-color: var(--accent);
+ }
+
.rev {
font-family: var(--mono);
font-size: 0.78rem;