diff options
| author | Joe Mou <dev@mou.fo> | 2026-01-23 01:07:48 -0500 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-01-23 01:08:24 -0500 |
| commit | c5cd5837cd194ba58a963258787fe8de8dce7e4b (patch) | |
| tree | 910a51c6ee44324d4a259868caed132fdfa834d0 /views/blob.eta | |
| parent | 0dfa9814ec998487c4f76e3418e0a232dbcceb7d (diff) | |
Refactor template layout
Diffstat (limited to 'views/blob.eta')
| -rw-r--r-- | views/blob.eta | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/views/blob.eta b/views/blob.eta index d3c6a56..566f5b0 100644 --- a/views/blob.eta +++ b/views/blob.eta @@ -1,37 +1,3 @@ -<!DOCTYPE html> -<html lang="en"> -<head> - <meta charset="UTF-8"> - <title><%= it.repo.owner %>/<%= it.repo.name %> - <%= it.path %></title> - <link rel="stylesheet" href="/static/style.css"> -</head> -<body> - <header> - <h1><%= it.repo.owner %>/<%= it.repo.name %></h1> - <div>branch: <%= it.branch %></div> - <div> - path: <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/tree/<%= it.branch %>">root</a><% - const pathParts = it.path.split('/').filter(p => p); - let currentPath = ''; - for (let i = 0; i < pathParts.length; i++) { - const part = pathParts[i]; - currentPath += (currentPath ? '/' : '') + part; - const isLast = i === pathParts.length - 1; - if (isLast) { - %>/<%= part %><% - } else { - %>/<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/tree/<%= it.branch %>/<%= currentPath %>"><%= part %></a><% - } - } %> - </div> - <% if (it.language) { %> - <div>language: <%= it.language %></div> - <% } %> - <div>size: <%= it.size %> bytes</div> - </header> +<% layout("./layout") %> - <pre class="blob"><code><%= it.rawContent %></code></pre> - - <footer>Generated by cgithub</footer> -</body> -</html> +<pre class="blob"><code><%= it.rawContent %></code></pre> |
