aboutsummaryrefslogtreecommitdiffstats
path: root/templates/package
diff options
context:
space:
mode:
Diffstat (limited to 'templates/package')
-rw-r--r--templates/package/content/swift.tmpl40
-rw-r--r--templates/package/metadata/swift.tmpl4
-rw-r--r--templates/package/view.tmpl2
3 files changed, 46 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}}
diff --git a/templates/package/metadata/swift.tmpl b/templates/package/metadata/swift.tmpl
new file mode 100644
index 0000000000..8a9ab071fc
--- /dev/null
+++ b/templates/package/metadata/swift.tmpl
@@ -0,0 +1,4 @@
+{{if eq .PackageDescriptor.Package.Type "swift"}}
+ {{if .PackageDescriptor.Metadata.Author.String}}<div class="item" title="{{.locale.Tr "packages.details.author"}}">{{svg "octicon-person" 16 "mr-3"}} {{.PackageDescriptor.Metadata.Author}}</div>{{end}}
+ {{if .PackageDescriptor.Metadata.RepositoryURL}}<div class="item">{{svg "octicon-link-external" 16 "mr-3"}} <a href="{{.PackageDescriptor.Metadata.RepositoryURL}}" target="_blank" rel="noopener noreferrer me">{{.locale.Tr "packages.details.project_site"}}</a></div>{{end}}
+{{end}}
diff --git a/templates/package/view.tmpl b/templates/package/view.tmpl
index 839d9cf21a..b2a2fb1e5d 100644
--- a/templates/package/view.tmpl
+++ b/templates/package/view.tmpl
@@ -33,6 +33,7 @@
{{template "package/content/pub" .}}
{{template "package/content/pypi" .}}
{{template "package/content/rubygems" .}}
+ {{template "package/content/swift" .}}
{{template "package/content/vagrant" .}}
</div>
<div class="four wide column">
@@ -59,6 +60,7 @@
{{template "package/metadata/pub" .}}
{{template "package/metadata/pypi" .}}
{{template "package/metadata/rubygems" .}}
+ {{template "package/metadata/swift" .}}
{{template "package/metadata/vagrant" .}}
<div class="item">{{svg "octicon-database" 16 "gt-mr-3"}} {{FileSize .PackageDescriptor.CalculateBlobSize}}</div>
</div>