From 4b86cf887f30988232c4877e828b231777ce3f4e Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Sat, 21 Feb 2026 16:46:11 +1100 Subject: Release styling --- cgithub/static/style.css | 58 ++++++++-------------------------------------- cgithub/views/_release.eta | 22 +++++++----------- cgithub/views/layout.eta | 1 + cgithub/views/release.eta | 4 ---- cgithub/views/releases.eta | 2 -- 5 files changed, 20 insertions(+), 67 deletions(-) diff --git a/cgithub/static/style.css b/cgithub/static/style.css index 896f138..fdf1b34 100644 --- a/cgithub/static/style.css +++ b/cgithub/static/style.css @@ -167,7 +167,7 @@ pre.box { width: fit-content; } -.overview { +.overview, .release { overflow-wrap: break-word; /* This is a bit convoluted: we want the effect of padding but using margins @@ -193,7 +193,7 @@ pre.box { border-bottom: 1px solid var(--border-color); } - img { + img, video { max-width: 100%; } @@ -207,6 +207,14 @@ pre.box { } } +.release > header { + display: flex; + align-items: baseline; + > :first-child { + flex-grow: 1; + } +} + .timestamp { white-space: nowrap; font-size: .8rem; @@ -232,52 +240,6 @@ pre.box { font-size: 0.8rem; } -.release-nav { - margin-bottom: 1rem; -} - -.release { - margin-bottom: 2rem; -} - -.release-header { - display: flex; - justify-content: space-between; - align-items: baseline; - margin-bottom: 1rem; - padding-bottom: .5rem; - border-bottom: 1px solid var(--border-color); - - h3 { - margin: 0; - } -} - -.release-body { - overflow-wrap: break-word; - - a { - text-decoration: underline; - } - - h1, h2 { - border-bottom: 1px solid var(--border-color); - } - - img { - max-width: 100%; - } - - code, pre { - background: var(--shade-background); - } - - pre { - overflow-x: auto; - scrollbar-color: var(--border-color) var(--shade-background); - } -} - /* TODO Strip permalinks? */ svg.octicon-link { display: none; diff --git a/cgithub/views/_release.eta b/cgithub/views/_release.eta index 85126a2..4769f9b 100644 --- a/cgithub/views/_release.eta +++ b/cgithub/views/_release.eta @@ -1,23 +1,19 @@
-
-

- <% if (it.linkToDetail) { %> - - <%= it.release.title %> - - <% } else { %> +
+ <% if (it.linkToDetail) { %> + <%= it.release.title %> - <% } %> -

+ + <% } else { %> + <%= it.release.title %> + <% } %> <% if (it.release.publishedAt) { %> <% } %> -
+ <% if (it.release.bodyHtml) { %> -
- <%~ it.release.bodyHtml %> -
+ <%~ it.release.bodyHtml %> <% } %>
diff --git a/cgithub/views/layout.eta b/cgithub/views/layout.eta index a404437..3910d4b 100644 --- a/cgithub/views/layout.eta +++ b/cgithub/views/layout.eta @@ -16,6 +16,7 @@ git clone git@github.com:<%= it.repo.owner %>/<%= it.repo.name %>.git Commits <% } %> + Releases diff --git a/cgithub/views/release.eta b/cgithub/views/release.eta index b8c0fe6..46dd5db 100644 --- a/cgithub/views/release.eta +++ b/cgithub/views/release.eta @@ -1,7 +1,3 @@ <% layout("./layout.eta") %> -
- ← All releases -
- <%~ include("./_release.eta", { repo: it.repo, release: it.release, linkToDetail: false }) %> diff --git a/cgithub/views/releases.eta b/cgithub/views/releases.eta index b3cb254..840908c 100644 --- a/cgithub/views/releases.eta +++ b/cgithub/views/releases.eta @@ -1,7 +1,5 @@ <% layout("./layout.eta") %> -

Releases

- <% for (const release of it.releases) { %> <%~ include("./_release.eta", { repo: it.repo, release, linkToDetail: true }) %> <% } %> -- cgit v1.3.1