pages/_includes/repository/repo_trophies.liquid
Dominik Fuchß 67bd1b6210
Make external service URLs configurable for repository page (#3422)
## Description

This PR makes the URLs for external services used on the repository page
configurable in `_config.yml`. This allows users to self-host these
services for better reliability, privacy, and customization.

## Changes

- Added `external_services` configuration section in `_config.yml` with:
- `github_readme_stats_url` (default:
`https://github-readme-stats.vercel.app`)
- `github_profile_trophy_url` (default:
`https://github-profile-trophy.vercel.app`)
- Updated repository template files to use configurable URLs:
  - `_includes/repository/repo_user.liquid`
  - `_includes/repository/repo.liquid`
  - `_includes/repository/repo_trophies.liquid`
- Added documentation in `CUSTOMIZE.md` explaining:
- Why self-hosting is recommended (default services may have
availability issues)
  - How to configure custom service URLs
  - Links to the service repositories for deployment instructions

## Resolves

Resolves #3388 - This makes it possible to configure self-hosted
versions of these services, giving users full control over the external
services used for displaying GitHub statistics and trophies.

## Testing

- Verified that default configuration still works with original service
URLs
- Confirmed that URLs are properly interpolated in all template files
- Documentation clearly explains the configuration options
2026-01-07 11:37:24 -03:00

43 lines
2.0 KiB
Plaintext

<div class="repo p-2 text-center">
<a href="https://github.com/ryo-ma/github-profile-trophy">
<span class="d-none d-sm-none d-md-block">
<img
class="only-light"
alt="{{ include.username }}"
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_light }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=6"
>
<img
class="only-dark"
alt="{{ include.username }}"
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_dark }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=6"
>
</span>
<span class="d-none d-sm-block d-md-none">
<img
class="only-light"
alt="{{ include.username }}"
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_light }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=4"
>
<img
class="only-dark"
alt="{{ include.username }}"
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_dark }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=4"
>
</span>
<span class="d-block d-sm-none">
<img
class="only-light"
alt="{{ include.username }}"
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_light }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=3"
>
<img
class="only-dark"
alt="{{ include.username }}"
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_dark }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=3"
>
</span>
</a>
</div>