diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-10-09 09:01:24 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-10-09 09:01:24 -0600 |
commit | 68e2091437e178dc98987d463180c17bfe346b9a (patch) | |
tree | d418d8c379736dd564af87ba935a172a61c28e0b /templates/repo_home.gph | |
parent | d5566a4ed9adf999e2e6a781913df27a0d9c77fe (diff) |
use the {{join}} function in gopher templates
$.Selector can be "/", which is handled better by 'join' than just concatenating with the template itself
Diffstat (limited to 'templates/repo_home.gph')
-rw-r--r-- | templates/repo_home.gph | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/repo_home.gph b/templates/repo_home.gph index 2ab17c2..29ed876 100644 --- a/templates/repo_home.gph +++ b/templates/repo_home.gph @@ -3,15 +3,15 @@ i{{ range .Repo.NameBytes }}-{{ end }} {{.Selector}} {{.Host}} {{.Port}} i {{.Selector}} {{.Host}} {{.Port}}
i{{.Repo.Description}} {{.Selector}} {{.Host}} {{.Port}}
i {{.Selector}} {{.Host}} {{.Port}}
-1⌥ Branches {{.Selector}}/branches {{.Host}} {{.Port}}
-1🏷️ Tags {{.Selector}}/tags {{.Host}} {{.Port}}
-1📄 Files {{.Selector}}/refs/HEAD/tree {{.Host}} {{.Port}}
+1⌥ Branches {{join .Selector "/branches"}} {{.Host}} {{.Port}}
+1🏷️ Tags {{join .Selector "/tags"}} {{.Host}} {{.Port}}
+1📄 Files {{join .Selector "/refs/HEAD/tree"}} {{.Host}} {{.Port}}
i {{.Selector}} {{.Host}} {{.Port}}
iLatest Commits: {{.Selector}} {{.Host}} {{.Port}}
i {{.Selector}} {{.Host}} {{.Port}}
{{ with .Repo.Commits .Ctx "HEAD" 5 -}} {{ range . -}} -1{{.ShortMessage}} {{$.Selector}}/refs/{{.Hash}} {{$.Host}} {{$.Port}}
+1{{.ShortMessage}} {{join $.Selector "/refs/" .Hash}} {{$.Host}} {{$.Port}}
{{ end -}} {{ if len . | eq 0 -}} i(no commits to show) {{$.Selector}} {{$.Host}} {{$.Port}}
|