1
0
Fork 0
forgejo/modules/setting
Gergely Nagy fcd0f61212
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>
2024-01-03 01:33:43 +01:00
..
config
actions.go [CI] DEFAULT_ACTIONS_URL = https://code.forgejo.org 2024-01-01 13:02:21 +01:00
actions_test.go [CI] DEFAULT_ACTIONS_URL = https://code.forgejo.org 2024-01-01 13:02:21 +01:00
admin.go [GITEA] notifies admins on new user registration 2024-01-01 15:20:56 +01:00
api.go
asset_dynamic.go
asset_static.go
attachment.go
attachment_test.go
badges.go Add support for shields.io-based badges 2024-01-03 01:33:43 +01:00
cache.go Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
camo.go
config.go
config_env.go
config_env_test.go
config_provider.go [GITEA] add GetFile to config provider 2024-01-01 13:50:27 +01:00
config_provider_test.go
cors.go Refactor CORS handler (#28587) 2023-12-25 20:13:18 +08:00
cron.go
cron_test.go
database.go [GITEA] Add slow SQL query warning 2024-01-01 15:20:56 +01:00
database_sqlite.go
database_test.go
federation.go
forgejo_storage_test.go [TESTS] verify facts for the admin storage documentation 2024-01-01 13:50:27 +01:00
git.go
git_test.go
highlight.go
i18n.go
incoming_email.go
indexer.go
indexer_test.go
lfs.go
lfs_test.go
log.go
log_test.go
mailer.go
mailer_test.go
markup.go
metrics.go
migrations.go
mime_type_map.go
mirror.go
oauth2.go
other.go
packages.go
packages_test.go
path.go
path_test.go
picture.go
project.go
proxy.go
queue.go
repository.go [GITEA] Configurable clone methods 2024-01-01 15:36:38 +01:00
repository_archive.go
repository_archive_test.go
security.go [GITEA] Revert "Deprecate query string auth tokens (#28390)" 2024-01-01 15:36:17 +01:00
server.go Avoid cycle-redirecting user/login page (#28636) 2023-12-30 08:48:34 +00:00
service.go [GITEA] add option for banning dots in usernames 2024-01-01 15:20:55 +01:00
service_test.go
session.go
setting.go Add support for shields.io-based badges 2024-01-03 01:33:43 +01:00
setting_test.go
ssh.go
storage.go
storage_test.go
task.go
time.go
ui.go Add option to disable ambiguous unicode characters detection (#28454) 2023-12-17 14:38:54 +00:00
webhook.go