diff options
| author | Joe Mou <dev@mou.fo> | 2026-07-15 00:16:30 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-07-15 00:43:28 -0400 |
| commit | c07865241ce113cbb26a939fd43fdf3461092c94 (patch) | |
| tree | c32bf4abc7a03fa3a9fe154b515928462ff90c2e /cgithub/views | |
| parent | 4b929ed4b27993874567516c40765ca5b53291df (diff) | |
User profile pages
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'cgithub/views')
| -rw-r--r-- | cgithub/views/home.eta | 2 | ||||
| -rw-r--r-- | cgithub/views/user.eta | 58 |
2 files changed, 59 insertions, 1 deletions
diff --git a/cgithub/views/home.eta b/cgithub/views/home.eta index adb71f2..0026ea3 100644 --- a/cgithub/views/home.eta +++ b/cgithub/views/home.eta @@ -12,7 +12,7 @@ </header> <main> - <p>Browse any GitHub repository by navigating to <code>/:owner/:repo</code></p> + <p>Browse any GitHub repository by navigating to <code>/:owner/:repo</code>, or a user profile at <code>/:user</code></p> </main> <h2>Credits</h2> diff --git a/cgithub/views/user.eta b/cgithub/views/user.eta new file mode 100644 index 0000000..cf2da94 --- /dev/null +++ b/cgithub/views/user.eta @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title><%= it.name ? `${it.name} (${it.login})` : it.login %></title> + <link rel="stylesheet" href="/static/style.css"> +</head> +<body> + <div class="box repo-info"> + <% if (it.avatarUrl) { %> + <img class="avatar" src="<%= it.avatarUrl %>" alt="" width="64" height="64"> + <% } %> + <div class="repo"><%= it.name || it.login %></div> + <div class="detail"><%= it.login %></div> + <% if (it.bio) { %> + <div class="description"><%= it.bio %></div> + <% } %> + <% if (it.followers) { %> + <div class="detail"><img src="/static/icons/eye.svg" alt="" class="icon"> <%= it.followers %> followers<%= it.following ? ` ยท ${it.following} following` : "" %></div> + <% } %> + <% if (it.company) { %> + <div class="detail"><%= it.company %></div> + <% } %> + <% if (it.location) { %> + <div class="detail"><%= it.location %></div> + <% } %> + <% for (const link of it.links) { %> + <div class="detail"><img src="/static/icons/link.svg" alt="" class="icon"> <a href="<%= link.href %>" rel="noopener noreferrer"><%= link.text %></a></div> + <% } %> + </div> + + <% if (it.pinned.length > 0) { %> + <section> + <h2>Pinned</h2> + <% for (const repo of it.pinned) { %> + <div class="box repo-info"> + <div><a href="/<%= repo.owner %>/<%= repo.name %>"><%= repo.owner === it.login ? repo.name : `${repo.owner}/${repo.name}` %></a></div> + <% if (repo.description) { %> + <div class="description"><%= repo.description %></div> + <% } %> + <% if (repo.language) { %> + <span class="detail"><%= repo.language %></span> + <% } %> + <% if (repo.stars) { %> + <span class="detail"><img src="/static/icons/star.svg" alt="stars" class="icon"> <%= repo.stars %></span> + <% } %> + <% if (repo.forks) { %> + <span class="detail"><img src="/static/icons/git-fork.svg" alt="forks" class="icon"> <%= repo.forks %></span> + <% } %> + </div> + <% } %> + </section> + <% } %> + + <footer>Generated by cgithub</footer> +</body> +</html> |
