0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-05 21:29:23 -05:00
forgejo/routers/web/repo
Gergely Nagy f90b802634
[GITEA] Add support for shields.io-based badges
Adds a new `/{username}/{repo}/badges` family of routes, which redirect
to various shields.io badges. The goal is to not reimplement badge
generation, and delegate it to shields.io (or a similar service), which
are already used by many. This way, we get all the goodies that come
with it: different styles, colors, logos, you name it.

So these routes are just thin wrappers around shields.io that make it
easier to display the information we want. The URL is configurable via
`app.ini`, and is templatable, allowing to use alternative badge
generator services with slightly different URL patterns.

Additionally, for compatibility with GitHub, there's an
`/{username}/{repo}/actions/workflows/{workflow_file}/badge.svg` route
that works much the same way as on GitHub. Change the hostname in the
URL, and done.

Fixes gitea#5633, gitea#23688, and also fixes #126.

Work sponsored by Codeberg e.V.

Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
(cherry picked from commit fcd0f61212)
(cherry picked from commit 20d14f7844)
(cherry picked from commit 4359741431)
(cherry picked from commit 35cff45eb8)
(cherry picked from commit 2fc0d0b8a3)
2024-02-05 16:09:42 +01:00
..
actions [GITEA] allow viewing the latest Action Run on the web 2024-02-05 16:09:41 +01:00
badges [GITEA] Add support for shields.io-based badges 2024-02-05 16:09:42 +01:00
setting [GITEA] Optionally allow anyone to edit Wikis 2024-02-05 16:09:42 +01:00
activity.go
attachment.go
blame.go
branch.go
cherry_pick.go
commit.go [GITEA] Detect file rename and show in history 2024-02-05 16:09:40 +01:00
compare.go
download.go
editor.go [GITEA] Allow user to select email for file operations in Web UI 2024-02-05 16:09:41 +01:00
editor_test.go
find.go
githttp.go
githttp_test.go
helper.go
helper_test.go
issue.go [GITEA] Fix /issues/search endpoint 2024-02-05 16:09:42 +01:00
issue_content_history.go
issue_dependency.go
issue_label.go
issue_label_test.go
issue_lock.go
issue_pin.go
issue_stopwatch.go
issue_test.go
issue_timetrack.go
issue_watch.go
main_test.go
middlewares.go
migrate.go
milestone.go
packages.go
patch.go
projects.go
projects_test.go
pull.go [GITEA] pulls: "Edit File" button in "Files Changed" tab 2024-02-05 16:09:42 +01:00
pull_review.go
release.go [GITEA] Allow release creation on commit 2024-02-05 16:05:50 +01:00
release_test.go
render.go
repo.go
search.go
topic.go
treelist.go
view.go [GITEA] repo: Don't redirect the repo to external units 2024-02-05 16:09:42 +01:00
view_test.go
wiki.go
wiki_test.go