blob: bfcd370d90ee95eb0f5ff7442d10edb8e83caf6d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
<!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>
<div class="repo"><%= it.repo.owner %>/<%= it.repo.name %></div>
<div class="branch"><img src="/static/icons/git-branch.svg" alt="branch" class="icon"> <%= it.branch %></div>
<% if (it.path) { %>
<span>
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/tree/<%= it.branch %>">(top)</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><%
}
} %>
</span>
<% } %>
<pre><code>git clone https://github.com/<%= it.repo.owner %>/<%= it.repo.name %>.git
git clone git@github.com:<%= it.repo.owner %>/<%= it.repo.name %>.git</code></pre>
</header>
<%~ it.body %>
<footer>Generated by cgithub</footer>
</body>
</html>
|