diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go index 26b94b87..26e3cafe 100644 --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -38,6 +38,12 @@ func (p *Pages) funcMap() template.FuncMap { "contains": func(s string, target string) bool { return strings.Contains(s, target) }, + "stripPort": func(hostname string) string { + if strings.Contains(hostname, ":") { + return strings.Split(hostname, ":")[0] + } + return hostname + }, "mapContains": func(m any, key any) bool { mapValue := reflect.ValueOf(m) if mapValue.Kind() != reflect.Map { diff --git a/appview/pages/templates/repo/empty.html b/appview/pages/templates/repo/empty.html index 188c10d9..18623ca5 100644 --- a/appview/pages/templates/repo/empty.html +++ b/appview/pages/templates/repo/empty.html @@ -35,7 +35,7 @@

1First, generate a new SSH key pair.

2Then add the public key to your account from the settings page.

-

3Configure your remote to git@{{ $knot }}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}

+

3Configure your remote to git@{{ $knot | stripPort }}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}

4Push!

diff --git a/appview/pages/templates/repo/fragments/cloneDropdown.html b/appview/pages/templates/repo/fragments/cloneDropdown.html index 708f12af..e4a0c380 100644 --- a/appview/pages/templates/repo/fragments/cloneDropdown.html +++ b/appview/pages/templates/repo/fragments/cloneDropdown.html @@ -48,8 +48,8 @@ git@{{ $knot }}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }} + data-url="git@{{ $knot | stripPort }}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}" + >git@{{ $knot | stripPort }}:{{ .RepoInfo.OwnerHandle }}/{{ .RepoInfo.Name }}