Rename to gitssg

This commit is contained in:
Miguel de la Cruz 2024-06-29 20:48:15 +02:00
parent 8be57baa83
commit 873ae748dc
7 changed files with 192 additions and 10 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
/gitstatic
/gitssg
/index.html

View file

@ -2,4 +2,4 @@ fmt:
go fmt ./...
build:
go build -o gitstatic ./gitstatic.go
go build -o gitssg ./gitssg.go

View file

@ -1,7 +1,10 @@
# Gitstatic
# GitSSG
Simple CLI tool to generate webpages from git repositories.
Project heavily inspired by the amazing
[stagit](https://codemadness.org/stagit.html).
## Roadmap
- [ ] Embed templates for the index and repository pages.

2
go.mod
View file

@ -1,4 +1,4 @@
module git.ctrlz.es/gitstatic
module git.ctrlz.es/gitssg
go 1.22.3

154
style.css Normal file
View file

@ -0,0 +1,154 @@
body {
color: #000;
background-color: #fff;
font-family: monospace;
}
h1, h2, h3, h4, h5, h6 {
font-size: 1em;
margin: 0;
}
img, h1, h2 {
vertical-align: middle;
}
img {
border: 0;
}
a:target {
background-color: #ccc;
}
a.d,
a.h,
a.i,
a.line {
text-decoration: none;
}
#blob a {
color: #555;
}
#blob a:hover {
color: blue;
text-decoration: none;
}
table thead td {
font-weight: bold;
}
table td {
padding: 0 0.4em;
}
#content table td {
vertical-align: top;
white-space: nowrap;
}
#branches tr:hover td,
#tags tr:hover td,
#index tr:hover td,
#log tr:hover td,
#files tr:hover td {
background-color: #eee;
}
#index tr td:nth-child(2),
#tags tr td:nth-child(3),
#branches tr td:nth-child(3),
#log tr td:nth-child(2) {
white-space: normal;
}
td.num {
text-align: right;
}
.desc {
color: #555;
}
hr {
border: 0;
border-top: 1px solid #555;
height: 1px;
}
pre {
font-family: monospace;
}
pre a.h {
color: #00a;
}
.A,
span.i,
pre a.i {
color: #070;
}
.D,
span.d,
pre a.d {
color: #e00;
}
pre a.h:hover,
pre a.i:hover,
pre a.d:hover {
text-decoration: none;
}
@media (prefers-color-scheme: dark) {
body {
background-color: #000;
color: #bdbdbd;
}
hr {
border-color: #222;
}
a {
color: #56c8ff;
}
a:target {
background-color: #222;
}
.desc {
color: #aaa;
}
#blob a {
color: #555;
}
#blob a:target {
color: #eee;
}
#blob a:hover {
color: #56c8ff;
}
pre a.h {
color: #00cdcd;
}
.A,
span.i,
pre a.i {
color: #00cd00;
}
.D,
span.d,
pre a.d {
color: #cd0000;
}
#branches tr:hover td,
#tags tr:hover td,
#index tr:hover td,
#log tr:hover td,
#files tr:hover td {
background-color: #111;
}
}

View file

@ -1,13 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Repositories</title>
<link rel="icon" type="image/png" href="favicon.png" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h3>Repositories</h3>
<table>
<tr><td><img src="logo.png" alt="" width="32" height="32" /></td>
<td><span class="desc">Repositories</span></td></tr><tr><td></td><td>
</td></tr>
</table>
<hr/>
<div id="content">
<table id="index"><thead>
<tr>
<td><b>Name</b></td>
<td><b>Description</b></td>
<td><b>Owner</b></td>
<td><b>Last commit</b></td>
</tr>
</thead>
<tbody>
{{- range .repoDirs}}
<p>{{ .Name }} :: {{.Owner}} :: {{.Description}} :: {{.LastCommit}}</p>
<tr>
<td><a href="{{.Name}}/log.html">{{.Name}}</a></td>
<td>{{.Description}}</td>
<td>{{.Owner}}</td>
<td>{{.LastCommit}}</td>
</tr>
{{- end}}
</tbody>
</table>
</div>
</body>
</html>