aboutsummaryrefslogtreecommitdiffstats
path: root/templates/package
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-05-14 17:38:40 +0200
committerGitHub <noreply@github.com>2023-05-14 23:38:40 +0800
commit5968c63a11c94b0fdde0485af194bebb2ea1b8e7 (patch)
tree8ff60c459712755a7346c4f5ed2e31e464af6cbe /templates/package
parent53a00017bbd89fddab11b323fc39872c44286d96 (diff)
downloadgitea-5968c63a11c94b0fdde0485af194bebb2ea1b8e7.tar.gz
gitea-5968c63a11c94b0fdde0485af194bebb2ea1b8e7.zip
Add Go package registry (#24687)
Fixes #7608 This PR adds a Go package registry usable with the Go proxy protocol. ![grafik](https://github.com/go-gitea/gitea/assets/1666336/328feb5c-3df2-4f9d-8eae-fe3126d14c37)
Diffstat (limited to 'templates/package')
-rw-r--r--templates/package/content/go.tmpl14
-rw-r--r--templates/package/view.tmpl1
2 files changed, 15 insertions, 0 deletions
diff --git a/templates/package/content/go.tmpl b/templates/package/content/go.tmpl
new file mode 100644
index 0000000000..2343d945b3
--- /dev/null
+++ b/templates/package/content/go.tmpl
@@ -0,0 +1,14 @@
+{{if eq .PackageDescriptor.Package.Type "go"}}
+ <h4 class="ui top attached header">{{.locale.Tr "packages.installation"}}</h4>
+ <div class="ui attached segment">
+ <div class="ui form">
+ <div class="field">
+ <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.go.install"}}</label>
+ <div class="markup"><pre class="code-block"><code>GOPROXY=<gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{$.PackageDescriptor.Owner.Name}}/go"></gitea-origin-url> go install {{$.PackageDescriptor.Package.Name}}@{{$.PackageDescriptor.Version.Version}}</code></pre></div>
+ </div>
+ <div class="field">
+ <label>{{.locale.Tr "packages.go.documentation" "https://docs.gitea.io/en-us/usage/packages/go" | Safe}}</label>
+ </div>
+ </div>
+ </div>
+{{end}}
diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl
index 3c42c3adfd..5285a0838d 100644
--- a/templates/package/view.tmpl
+++ b/templates/package/view.tmpl
@@ -28,6 +28,7 @@
{{template "package/content/container" .}}
{{template "package/content/debian" .}}
{{template "package/content/generic" .}}
+ {{template "package/content/go" .}}
{{template "package/content/helm" .}}
{{template "package/content/maven" .}}
{{template "package/content/npm" .}}