Skip to content

A small, standalone badge system in PHP that works without Redis/Docker/Node. It supports static and dynamic (GitHub, Codeberg, Forgejo) badges, styles (similar to Shields), colors, languages ​​(German/English), and simple file caching.

License

Notifications You must be signed in to change notification settings

RonDevHub/Mini-Badges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mini-Badges I❤️PHP

🫵 Please note that this is not a complete alternative to Shields.io, nor is it intended to replace or extend it. This is a small project I created for personal use. It is aimed at anyone who wants to run their own badges privately. It is not designed to be used as a service for multiple users. Please also keep in mind that, due to API calls, this project may eventually reach its limits. Nevertheless, I hope that some people will enjoy it and perhaps make use of it. The Wiki is still under construction. Support: Matrix Chat


GitHub Repo stars GitHub Repo stars Issues GitHub Repo language GitHub Repo license Release Forks Watchers Last update GitHub Repo downlods Milestones Info Jenkins Build

Buy me a coffee Buy me a coffee Sponsor me Pizza Power


A small, standalone PHP Badge System – no Redis, Docker, or Node required.
It supports static and dynamic (GitHub) badges, multiple styles (similar to Shields),
colors, languages (de/en), and simple file caching.


🚀 Installation

  1. Upload the contents of this folder to your webspace (e.g. /www/htdocs/.../badges/).
  2. Make sure the cache/ directory is writable (e.g. 0775 or 0777).
  3. (Optional) Add a GitHub token in helpers/config.php (for higher rate limits).
  4. Open examples.html in your browser.

🎯 Usage (Examples)

URL input Badge output
Underscore _ Space
Double underscore __ Underscore _
Double dash -- Dash -
Star (asterisk) * Placeholder Default Value

🔹 Static

URL pattern:
static/{textLabel}-{bgColor}-{textColor}/{textMessage}-{bgColor}-{textColor}/{style}

Example:
Static
static/RonDevHub❤️PHP-000000/Awesome-3a6e8f/flat


🔹 With Icon

URL pattern:
icon/{icon}-{iconColor}/{textMessage}-{bgColor}-{textColor}/{style}/{textLabel}-{bgColor}-{textColor}

Examples:
With Icon
/icon/github-gray/Github-*-000000/flat

With Icon
/icon/github/👍-teal/*/Github-6d6e70


💻 GitHub

URL pattern:
/github/{owner}/{repo}/{metric}/{style}/{icon}-{iconColor}/{lang}/{backgroundColorMessage}-{textColorMessage}/{backgroundLabelColor}-{textColorLabel}

Examples:

  • Stars: GitHub Stars
    github/{owner}/{repo}/stars/*/*/de

  • Top language: GitHub Top Language
    github/{owner}/{repo}/top_language/*/*/*/green

  • With icon: GitHub Forks
    github/{owner}/{repo}/forks/round/codefork/*/green


⚙️ Parameters

  • {textMessage} – Badge message text (right side)
  • {textLabel} – Badge label text (left side)
  • {bgColor} – Background color (default: Label #555, Message #0B7DBE)
  • {textColor} – Text color (default: Label & Message #fff)
  • {style}=flat|flat-square|plastic|round|for-the-badge (default: flat)

Examples:
flat flat-square plastic round for-the-badge for-the-badge for-the-badge for-the-badge for-the-badge

  • {lang}=en|de (default: en) → Used for GitHub badges. Can be extended.
  • {icon} – Name of an SVG in icons/ (without .svg). Colored with currentColor.
  • {iconColor} – Icon color (default: #fff)

💻 GitHub-specific

  • {metric} - For example stars, license, issues ... more metrics are listed in the wiki
  • {owner} – GitHub user/org
  • {repo} – GitHub repository

:codeberg: Codeberg-specific

  • {metric} - For example stars, license, issues ... more metrics are listed in the CHANGELOG.md
  • {owner} – Codeberg user/org
  • {repo} – Codeberg repository

🖼️ Icons

⚠️ Note:
This download contains no icons.
Place your SVGs (with fill="currentColor") in the icons/ folder, e.g. icons/star.svg.
Then use /star/ in the URL.


📜 License

GitHub Repo license

About

A small, standalone badge system in PHP that works without Redis/Docker/Node. It supports static and dynamic (GitHub, Codeberg, Forgejo) badges, styles (similar to Shields), colors, languages ​​(German/English), and simple file caching.

Topics

Resources

License

Stars

Watchers

Forks