Skip to content

πŸ† Add dynamically generated GitHub Stat Trophies on your readme

License

Notifications You must be signed in to change notification settings

rstar327/github-profile-trophy

Repository files navigation

GitHub Profile Trophy

GitHub Profile Trophy

πŸ† Add dynamically generated GitHub Stat Trophies on your README

stargazers forks issues license share

You can use this service for free. I'm looking for sponsors to help us keep up with this service❀️

Quick Start

Add the following code to your readme. When pasting the code into your profile's readme, change the ?username= value to your GitHub's username.

[![trophy](https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327)](https://github.com/rstar327/github-profile-trophy)

Quickstart trophy example

Use theme

Add optional parameter of the theme.

[![trophy](https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&theme=onedark)](https://github.com/rstar327/github-profile-trophy)

One Dark theme example

More detail

About Rank

Ranks are SSS SS S AAA AA A B C UNKNOWN SECRET.

Rank Description
SSS, SS, S You are at a hard to reach rank. You can brag.
AAA, AA, A You will reach this rank if you do your best. Let's aim here first.
B, C You are currently making good progress. Let's aim a bit higher.
UNKNOWN You have not taken action yet. Let's act first.
SECRET This rank is very rare. The trophy will not be displayed until certain conditions are met.

NOTE: The UNKNOWN rank is denoted by ?

Secret Rank

The acquisition condition is secret, but you can see this.

Secret rank trophy

There are only a few secret trophies. Therefore, if you come up with interesting conditions, I will consider adding a trophy. I am waiting for contributions.

About Display details

Trophy display details

  1. Title name of aggregation target.
  2. Current rank.
  3. Title according to rank.
  4. Target aggregation result.
  5. Rank progress bar.

Optional Request Parameters

Filter by titles

You can filter the display by specifying the titles of trophy.

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&title=Followers

Filter by Followers title

If you want to specify multiple titles.

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&title=Stars,Followers

Filter by Stars and Followers titles

You can also exclude the trophies you don't want to display.

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&title=-Stars,-Followers

Filter by ranks

You can filter the display by specifying the ranks.
Available values: SECRET SSS SS S AAA AA A B C

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&rank=S

Filter by S rank

If you want to specify multiple ranks.

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&rank=S,AAA

Filter by S and AAA ranks

You can also exclude ranks.

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&rank=-C,-B

NOTE: Since UNKNOWN is denoted by ?, in order to include or exclude it you will have to use rank=? and rank=-? respectively

Specify the maximum row & column size

You can specify the maximum row and column size.
Trophy will be hidden if it exceeds the range of both row and column.

Available value: number type
Default: column=6 row=3

Restrict only row

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&row=2

Restrict only column

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&column=2

Restrict row & column

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&row=2&column=3

2 rows and 3 columns layout

Adaptive column

https://github-profile-trophy-rstar327.vercel.app/api/?username=rstar327&column=-1

You can set column to -1 to adapt the width to the number of trophies, the parameter row will be ignored.

Apply theme

Available themes.

theme
flat
onedark
gruvbox
dracula
monokai
chalk
nord
alduin
darkhub
juicyfresh
buddhism
oldie
radical
onestar
discord
algolia
gitdimmed
tokyonight
matrix
apprentice
dark_dimmed
dark_lover
kimbie_dark
aura

flat

Flat theme preview

onedark

One Dark theme preview

gruvbox

Gruvbox theme preview

dracula

Dracula theme preview

monokai

Monokai theme preview

chalk

Chalk theme preview

nord

Nord theme preview

alduin

Alduin theme preview

darkhub

Dark Hub theme preview

juicyfresh

Juicy Fresh theme preview

buddhism

Buddhism theme preview

oldie

Oldie theme preview

radical

Radical theme preview

onestar

One Star theme preview

discord

Discord theme preview

algolia

Algolia theme preview

gitdimmed

Git Dimmed theme preview

tokyonight

Tokyo Night theme preview

matrix

Matrix theme preview

apprentice

Apprentice theme preview

dark_dimmed

Dark Dimmed theme preview

dark_lover

Dark Lover theme preview

kimbie_dark

Kimbie Dark theme preview

aura

Aura theme preview

Margin Width

You can put a margin in the width between trophies.
Available value: number type
Default: margin-w=0

Margin width example

Margin Height

You can put a margin in the height between trophies.
Available value: number type
Default: margin-h=0

Margin height example

Example layout

Example layout

Transparent background

You can turn the background transparent.
Available value: boolean type (true or false)
Default: no-bg=false

Transparent background example

Hide frames

You can hide the frames around the trophies.
Available value: boolean type (true or false)
Default: no-frame=false

Hidden frames example

Generate an svg file localy

Using the render_svg.ts script you can generate your trophys as an svg file given your username, (Enviroment Vars: See env-example).

Usage:

deno run --allow-net --allow-env --allow-read --allow-write ./render_svg.ts USERNAME OUTPUT_DIR THEME

Generate an svg inside Github CI (Workflow)

Using the provided github action you can easly generate the trophy inside an github workflow. This eliminates the needs of an online service running but you have to manualy update rerun the action to update the file.

Usage:

- name: Generate trophy
  uses: Erik-Donath/github-profile-trophy@feature/generate-svg
  with:
    username: your-username
    output_path: trophy.svg
    token: ${{ secrets.GITHUB_TOKEN }}

Contribution Guide

Check CONTRIBUTING.md for more details.

License

This product is licensed under the MIT License.

About

πŸ† Add dynamically generated GitHub Stat Trophies on your readme

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 68