@@ 106,6 106,19 @@ M.urls = {
return string.format('%s/+log/%s/%s', opts.base_url, opts.ref, opts.filepath)
end,
},
+ cgit = {
+ blob_url = function(opts)
+ local position = pos_to_path(opts, '#n%d')
+ return string.format('%s/tree/%s?id=%s%s', opts.base_url, opts.filepath, opts.ref, position)
+ end,
+ blame_url = function(opts)
+ local position = pos_to_path(opts, '#n%d')
+ return string.format('%s/blame/%s?id=%s%s', opts.base_url, opts.filepath, opts.ref, position)
+ end,
+ raw_url = function(opts)
+ return string.format('%s/plain/%s?id=%s', opts.base_url, opts.filepath, opts.ref)
+ end,
+ },
}
--- @class RepoUrl.Config
@@ 122,6 135,7 @@ local config = {
['gitlab.alpinelinux.org'] = M.urls.gitlab,
['codeberg.org'] = M.urls.codeberg,
['go.googlesource.com'] = M.urls.gitiles,
+ ['git.zx2c4.com'] = M.urls.cgit,
},
}