From 6fe9d3280e2d675726c9d5c09538354992049b5d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Tue, 2 Dec 2025 14:39:35 +0000 Subject: improve repository landing page --- src/http/landing.rs | 109 +++++++++++++++++++++------------------------------- 1 file changed, 44 insertions(+), 65 deletions(-) (limited to 'src') diff --git a/src/http/landing.rs b/src/http/landing.rs index df69a9d..f3f8201 100644 --- a/src/http/landing.rs +++ b/src/http/landing.rs @@ -218,11 +218,6 @@ pub fn get_404_html(config: &Config, npub: &str, identifier: &str) -> String { /// GRASP-01: "SHOULD serve a webpage at the same endpoint linking to git nostr client(s) /// to browse the repository" pub fn get_repo_html(config: &Config, npub: &str, identifier: &str) -> String { - let clone_url = format!( - "http://{}/{}/{}.git", - config.domain, npub, identifier - ); - format!( r##" @@ -234,10 +229,9 @@ pub fn get_repo_html(config: &Config, npub: &str, identifier: &str) -> String { {base_css} .container {{ max-width: 720px; margin: 0 auto; padding: 60px 24px; }} .back-link {{ margin-bottom: 32px; }} - .header {{ display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }} - .logo {{ width: 40px; height: 40px; }} + .header {{ margin-bottom: 8px; }} h1 {{ font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; }} - .subtitle {{ color: var(--text-muted); margin-bottom: 40px; }} + .subtitle {{ color: var(--text-muted); }} .section {{ margin-bottom: 32px; }} .section-title {{ font-size: 0.75rem; @@ -254,14 +248,6 @@ pub fn get_repo_html(config: &Config, npub: &str, identifier: &str) -> String { padding: 16px 20px; }} .card + .card {{ margin-top: 8px; }} - .info-row {{ - display: flex; - justify-content: space-between; - align-items: center; - padding: 8px 0; - }} - .info-row + .info-row {{ border-top: 1px solid var(--border); }} - .info-label {{ font-size: 0.875rem; color: var(--text-muted); }} code {{ font-size: 0.8rem; word-break: break-all; }} .clone-box {{ background: var(--bg); @@ -273,12 +259,36 @@ pub fn get_repo_html(config: &Config, npub: &str, identifier: &str) -> String { color: var(--text); overflow-x: auto; }} + .clone-line {{ margin-bottom: 8px; }} + .clone-line:last-child {{ margin-bottom: 0; }} .clone-box .cmd {{ color: var(--text-muted); }} .clone-box .url {{ color: var(--success); }} - .client-card {{ display: flex; justify-content: space-between; align-items: center; }} - .client-info {{ display: flex; flex-direction: column; }} - .client-name {{ font-weight: 500; }} - .client-desc {{ font-size: 0.875rem; color: var(--text-muted); }} + .browse-link {{ + display: inline-block; + background: var(--brand); + color: white; + padding: 14px 24px; + border-radius: 8px; + font-weight: 500; + font-size: 1rem; + margin: 32px 0; + transition: background 0.2s; + text-align: center; + }} + .browse-link:hover {{ + background: var(--brand-light); + text-decoration: none; + }} + .browse-link .browse-identifier {{ + display: block; + font-size: 1.125rem; + font-weight: 600; + }} + .browse-link .browse-site {{ + display: block; + font-size: 0.875rem; + opacity: 0.9; + }} @@ -287,62 +297,29 @@ pub fn get_repo_html(config: &Config, npub: &str, identifier: &str) -> String { ← {relay_name}
-

{identifier}

+

by {npub}

Git repository hosted on {relay_name}

-
-
Repository Info
-
-
- Owner - {npub} -
-
- Identifier - {identifier} -
-
-
+ + + Browse Repository + on GitWorkshop.dev → + +
Clone
- git clone {clone_url} -
-
-
-
-
Browse with Git Nostr Clients
-
-
- gitworkshop.dev - Web-based repository browser -
- Visit → -
-
-
- ngit - Command-line Git + Nostr tool +
curl -Ls https://ngit.dev/install.sh | bash
+
git clone nostr://{npub}//{identifier}
- GitHub → -
-
-
-
Documentation
-