From d1638198df3a65fe89bfb28f6e1dd285877b55bc Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Wed, 2 Jul 2025 20:45:16 +0200 Subject: feat: Show git clone url on summary --- templates/gititemsummary.qtpl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'templates/gititemsummary.qtpl') diff --git a/templates/gititemsummary.qtpl b/templates/gititemsummary.qtpl index f39a613..7f56837 100644 --- a/templates/gititemsummary.qtpl +++ b/templates/gititemsummary.qtpl @@ -1,3 +1,4 @@ +{% import "net/url" %} {% import "github.com/go-git/go-git/v5/plumbing" %} {% import "git.gabrielgio.me/cerrado/pkg/git" %} @@ -6,12 +7,26 @@ type GitItemSummaryPage struct { Tags []*git.TagReference Branches []*plumbing.Reference Commits []*git.CommitReference + Hostname string } %} +{% code + +func mergeURL(hostname, name string) string { + s, _ := url.JoinPath(hostname, name) + return s +} + +%} + {% func (g *GitItemSummaryPage) Nav(name, ref string) %}{%= GitItemNav(name, ref, Summary) %}{% endfunc %} {% func (g *GitItemSummaryPage) GitContent(name, ref string) %} +
+
clone: 
+
{%s mergeURL(g.Hostname, name) %}
+
{%= ListTags(name, g.Tags) %} -- cgit v1.2.3