diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2023-03-13 21:28:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-13 15:28:39 -0500 |
commit | c709fa17a77eae391cafbe72d6b2594f74d86a60 (patch) | |
tree | 9c6ab67126c7d59a6db274ec5a9f75cdfe120be6 /templates/package/content | |
parent | 0a6f6354bbc03d4a3ad382a432113301e9ea9d86 (diff) | |
download | gitea-c709fa17a77eae391cafbe72d6b2594f74d86a60.tar.gz gitea-c709fa17a77eae391cafbe72d6b2594f74d86a60.zip |
Add Swift package registry (#22404)
This PR adds a [Swift](https://www.swift.org/) package registry.
![grafik](https://user-images.githubusercontent.com/1666336/211842523-07521cbd-8fb6-400f-820c-ee8048b05ae8.png)
Diffstat (limited to 'templates/package/content')
-rw-r--r-- | templates/package/content/swift.tmpl | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/templates/package/content/swift.tmpl b/templates/package/content/swift.tmpl new file mode 100644 index 0000000000..3ff06483b8 --- /dev/null +++ b/templates/package/content/swift.tmpl @@ -0,0 +1,40 @@ +{{if eq .PackageDescriptor.Package.Type "swift"}} + <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.swift.registry"}}</label> + <div class="markup"><pre class="code-block"><code>swift package-registry set <gitea-origin-url data-url="{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/swift"></gitea-origin-url></code></pre></div> + </div> + <div class="field"> + <label>{{svg "octicon-code"}} {{.locale.Tr "packages.swift.install" | Safe}}</label> + <div class="markup"><pre class="code-block"><code>dependencies: [ + .package(id: "{{.PackageDescriptor.Package.Name}}", from:"{{.PackageDescriptor.Version.Version}}") +]</code></pre></div> + </div> + <div class="field"> + <label>{{svg "octicon-terminal"}} {{.locale.Tr "packages.swift.install2"}}</label> + <div class="markup"><pre class="code-block"><code>swift package resolve</code></pre></div> + </div> + <div class="field"> + <label>{{.locale.Tr "packages.swift.documentation" | Safe}}</label> + </div> + </div> + </div> + + {{if .PackageDescriptor.Metadata.Description}} + <h4 class="ui top attached header">{{.locale.Tr "packages.about"}}</h4> + <div class="ui attached segment"> + {{if .PackageDescriptor.Metadata.Description}}{{.PackageDescriptor.Metadata.Description}}{{end}} + </div> + {{end}} + + {{if .PackageDescriptor.Metadata.Keywords}} + <h4 class="ui top attached header">{{.locale.Tr "packages.keywords"}}</h4> + <div class="ui attached segment"> + {{range .PackageDescriptor.Metadata.Keywords}} + {{.}} + {{end}} + </div> + {{end}} +{{end}} |