gshr
git static host repo -- generates static html for repos
git clone https://git.vogt.world/gshr.git
Log | Files | README.md | LICENSE
← Commit log
commit
message
Multirepo generally working
author
Ben Vogt <[email protected]>
date
2023-04-04 23:42:10
stats
4 file(s) changed, 6 insertions(+), 4 deletions(-)
files
file.go
templates/commit.html
templates/files.html
templates/log.html
 1diff --git a/file.go b/file.go
 2index 0cf7e18..539e367 100644
 3--- a/file.go
 4+++ b/file.go
 5@@ -54,7 +54,7 @@ func RenderSingleFilePages(data RepoData) {
 6 			_, canRenderExtension := settings.TextExtensions[ext]
 7 			_, canRenderByFullName := settings.PlainFiles[filepath.Base(filename)]
 8 			partialPath, _ := strings.CutPrefix(filename, path.Join(args.CloneDir, data.Name))
 9-			outputName := path.Join(args.OutputDir, "files", partialPath, "index.html")
10+			outputName := path.Join(args.OutputDir, data.Name, "files", partialPath, "index.html")
11 			debug("reading %v %v", data.Name, partialPath)
12 			(&FilePage{
13 				RepoData:       data,
14diff --git a/templates/commit.html b/templates/commit.html
15index 0a5359b..3f9d4d0 100644
16--- a/templates/commit.html
17+++ b/templates/commit.html
18@@ -14,7 +14,7 @@
19           <tr>
20             <td><b>commit: </b></td>
21             <td>
22-              <a href="{{ .RepoData.BaseURL }}commit/{{ .Hash }}/">
23+              <a href="{{ .RepoData.BaseURL }}{{ .RepoData.Name }}/commit/{{ .Hash }}/">
24                 {{ .Hash }}
25               </a>
26             </td>
27diff --git a/templates/files.html b/templates/files.html
28index f9af0fb..695f77d 100644
29--- a/templates/files.html
30+++ b/templates/files.html
31@@ -22,7 +22,7 @@
32           <tr>
33             <td>{{ .Mode }}</td>
34             <td>
35-              <a href="{{ $.RepoData.BaseURL }}files/{{ .Name }}/index.html">
36+              <a href="{{ $.RepoData.BaseURL }}{{ $.RepoData.Name }}/files/{{ .Name }}/index.html">
37                 {{ .Name }}
38               </a>
39             </td>
40diff --git a/templates/log.html b/templates/log.html
41index 0ecd756..4f9ca7a 100644
42--- a/templates/log.html
43+++ b/templates/log.html
44@@ -25,7 +25,9 @@
45           <tr>
46             <td>{{ .Date }}</td>
47             <td class="commit">
48-              <a href="{{ $.RepoData.BaseURL }}commit/{{ .Hash }}">{{ .Message }}</a>
49+              <a href="{{ $.RepoData.BaseURL }}{{ $.RepoData.Name }}/commit/{{ .Hash }}">
50+                {{ .Message }}
51+              </a>
52             </td>
53             <td>{{ .Author }}</td>
54             <td align="right">{{ .FileChangeCount }}</td>