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
Git url for nav/metadata
author
Ben Vogt <[email protected]>
date
2023-04-04 19:19:39
stats
3 file(s) changed, 4 insertions(+), 2 deletions(-)
files
Makefile
main.go
templates/partials.html
 1diff --git a/Makefile b/Makefile
 2index f2c0199..b6bc35d 100644
 3--- a/Makefile
 4+++ b/Makefile
 5@@ -27,6 +27,7 @@ dev: Makefile target target/output target/cloning target/gshr-${OS}-${ARCH}-${EN
 6     --name="gshr" \
 7     --desc="git static host repo -- generates static html for repo" \
 8     --repo=/Users/bvogt/dev/src/ben/gshr \
 9+    --git-url="[email protected]:./gshr.git" \
10     --output=$(PWD)/target/output \
11     --clone=$(PWD)/target/cloning \
12 		&& \
13diff --git a/main.go b/main.go
14index 0ce88a2..7b8f8b5 100644
15--- a/main.go
16+++ b/main.go
17@@ -96,6 +96,7 @@ func DefaultConfig() Config {
18 
19 type RepoData struct {
20 	Name        string
21+	GitURL      string
22 	Description string
23 	BaseURL     string
24 }
25@@ -107,6 +108,7 @@ func main() {
26 	flag.StringVar(&config.OutputDir, "output", "", "Dir of output.")
27 	flag.StringVar(&config.CloneDir, "clone", "", "Directory to clone into. Defaults to /tmp/${rand}")
28 	flag.StringVar(&config.BaseURL, "base-url", "/", "Base URL for serving.")
29+	flag.StringVar(&config.RepoData.GitURL, "git-url", "", "Show where repo is hosted.")
30 	flag.StringVar(&config.RepoData.Name, "name", "untitled repo", "Name for display")
31 	flag.StringVar(&config.RepoData.Description, "desc", "untitled repo", "Description for display")
32 	flag.Parse()
33diff --git a/templates/partials.html b/templates/partials.html
34index 901b147..a605666 100644
35--- a/templates/partials.html
36+++ b/templates/partials.html
37@@ -27,8 +27,7 @@
38       </tr>
39       <tr>
40         <td>
41-          git clone
42-          <a href="[email protected]:./www.gitc">[email protected]:./www.git</a>
43+          <a href="{{ .GitURL }}">{{ .GitURL }}</a>
44         </td>
45       </tr>
46       <tr>