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;