aboutsummaryrefslogtreecommitdiffstats
path: root/templates/package/content
diff options
context:
space:
mode:
authormerlleu <r.langdorph@gmail.com>2023-09-13 06:14:10 +0200
committerGitHub <noreply@github.com>2023-09-13 12:14:10 +0800
commite6a059a3d0c699e00c05cfa81ab3bfd0598a89a2 (patch)
tree03dfcb2a8267261f4fcd3eacac08c3db62cd5f20 /templates/package/content
parentaaeec2a3925c8e45c14179a3e6260b92e53197d2 (diff)
downloadgitea-e6a059a3d0c699e00c05cfa81ab3bfd0598a89a2.tar.gz
gitea-e6a059a3d0c699e00c05cfa81ab3bfd0598a89a2.zip
add sparse url in cargo package guide (#26937)
Hello, The current package guide for cargo gives you only the git index, with the HTTP Index stabilized being used as default for crates.io and being better for most use-cases. However, it's not documented that gitea supports the sparse spec, and it does not require the _crates-index git repo for the sparse api. I personally think we should push users to use the sparse instead of the git repository. (Even let users disable crates-index repos if they only want to use sparse)
Diffstat (limited to 'templates/package/content')
-rw-r--r--templates/package/content/cargo.tmpl3
1 files changed, 2 insertions, 1 deletions
diff --git a/templates/package/content/cargo.tmpl b/templates/package/content/cargo.tmpl
index b7a34632e4..67e003c9d1 100644
--- a/templates/package/content/cargo.tmpl
+++ b/templates/package/content/cargo.tmpl
@@ -8,7 +8,8 @@
default = "gitea"
[registries.gitea]
-index = "<gitea-origin-url data-url="{{AppSubUrl}}/{{.PackageDescriptor.Owner.Name}}/_cargo-index.git"></gitea-origin-url>"
+index = "<gitea-origin-url data-url="sparse+{{AppSubUrl}}/api/packages/{{.PackageDescriptor.Owner.Name}}/cargo/"></gitea-origin-url>" # Sparse index
+# index = "<gitea-origin-url data-url="{{AppSubUrl}}/{{.PackageDescriptor.Owner.Name}}/_cargo-index.git"></gitea-origin-url>" # Git
[net]
git-fetch-with-cli = true</code></pre></div>