aboutsummaryrefslogtreecommitdiff
path: root/views/layout.eta
diff options
context:
space:
mode:
Diffstat (limited to 'views/layout.eta')
-rw-r--r--views/layout.eta41
1 files changed, 41 insertions, 0 deletions
diff --git a/views/layout.eta b/views/layout.eta
new file mode 100644
index 0000000..8e5d9d9
--- /dev/null
+++ b/views/layout.eta
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title><%= it.repo.owner %>/<%= it.repo.name %> - <%= it.path || 'root' %></title>
+ <link rel="stylesheet" href="/static/style.css">
+</head>
+<body>
+ <header>
+ <h1><%= it.repo.owner %>/<%= it.repo.name %></h1>
+ <div>branch: <%= it.branch %></div>
+ <% if (it.path) { %>
+ <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>
+ <% } %>
+ <% if (it.size !== undefined) { %>
+ <div>size: <%= it.size %> bytes</div>
+ <% } %>
+ </header>
+
+ <%~ it.body %>
+
+ <footer>Generated by cgithub</footer>
+</body>
+</html>