Skip to content

Commit 425fa24

Browse files
authored
feat: host the README badge at commit-check.com/badge.svg (#46)
This serves the Commit Check badge from the site, so the snippet a user copies becomes one line: ```markdown [![commit-check](https://commit-check.com/badge.svg)](https://commit-check.com) ``` Today the snippet is a 519-character shields.io URL with the mark base64-encoded into it, and every page view makes a request to a third party. conventionalbranch.org/badge.svg already works this way. ## What's in it - **`docs/badge.svg`.** This is a hand-written copy of the shields.io render of the brand badge from [`branding/README.md`](https://github.com/commit-check/.github/blob/main/branding/README.md). It has the same 157×20 size, the same colors and flat style, and the same `textLength`, which keeps the text identical on machines without Verdana. The mark is drawn as vectors instead of an embedded image. A comment in the file explains all of this, including the contrast trade-off: white on Signal Blue is about 3:1, which is the color the badge has always had. MkDocs copies the file to the site root. - **Getting started.** A short *Show that you use it* section now shows the badge, with Markdown and reStructuredText snippets in tabs. Until now only the READMEs documented the badge. ## Checks - I rendered both files with `rsvg-convert` at 6× and compared them with ImageMagick. At 8% fuzz, 0 pixels differ, and the RMSE is 1.5e-5. - `mkdocs build --strict` passes (with `SOCIAL_CARDS=false`). `site/badge.svg` is in the output, and the page links it as `../badge.svg`. - `python -m pytest tests/ -q` passes with the released commit-check installed (10 tests). The pins and the changelog were already at 2.18.1, so nothing needed bringing into step. ## After this deploys Once `https://commit-check.com/badge.svg` is live, the long snippet elsewhere can switch to the short one: - the *Show that you use it* sections of the commit-check and commit-check-action READMEs (commit-check/commit-check#587, commit-check/commit-check-action#293); - the *README badge* section of `branding/README.md` in `.github`. The badge rows in those READMEs can stay on shields.io. Only the snippet users copy needs to change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Added a “Show that you use it” section with a commit-check badge and copyable Markdown and reStructuredText snippets. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 6886d4a commit 425fa24

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

‎docs/badge.svg‎

Lines changed: 51 additions & 0 deletions
Loading

‎docs/getting-started.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,27 @@ a release artifact came from this repository's build pipeline:
180180
$ gh attestation verify commit_check-*.whl --repo commit-check/commit-check
181181
```
182182

183+
## Show that you use it
184+
185+
Put the badge in your README, so contributors know their commits will be
186+
checked before they open a pull request:
187+
188+
[![commit-check](badge.svg)](https://commit-check.com)
189+
190+
=== "Markdown"
191+
192+
```markdown
193+
[![commit-check](https://commit-check.com/badge.svg)](https://commit-check.com)
194+
```
195+
196+
=== "reStructuredText"
197+
198+
```rst
199+
.. image:: https://commit-check.com/badge.svg
200+
:target: https://commit-check.com
201+
:alt: commit-check
202+
```
203+
183204
## Where to go next
184205

185206
- **[Where to run it](guides/integrations.md)** — pre-commit hook, GitHub

0 commit comments

Comments
 (0)