Skip to content

feat(docs): add custom badge generator#2152

Merged
ghostdevv merged 22 commits intonpmx-dev:mainfrom
trueberryless:feature/docs-custom-badges-inputs
Mar 21, 2026
Merged

feat(docs): add custom badge generator#2152
ghostdevv merged 22 commits intonpmx-dev:mainfrom
trueberryless:feature/docs-custom-badges-inputs

Conversation

@trueberryless
Copy link
Contributor

@trueberryless trueberryless commented Mar 19, 2026

🧭 Context

In the last npmx meetup, we were discussing the idea of adding a generator inside the docs for custom badges to simplify the process of getting the Markdown content.

So I played around with the idea a little bit and landed on this implementation, which I find pretty useful.

📚 Description

I moved the custom badges docs to their dedicated page because they are like 50% of the features page and I think since there are many subheadings, it makes sense to be able to see them in the ToC (therefore the dedicated page).

And then I created a little BadgeGenerator.vue which let's the user input the package name and the type of info they wanna have in the badge with a little preview.

Feel free to suggest reverts or further ideas for this improvement.

I also played around a bit with updating the package in the ## Examples section dynamically to what the user currently has typed in the input, but I couldn't figure out a clean way to create the code block like this with a component, which sucks a little bit. Therefore, I dropped this, but if you know how we could do that, feel free to guide me to a possible solution.

Here is a deployment preview of the right page: https://docsnpmxdev-git-fork-trueberryless-feature-docs-cus-74ef86-npmx.vercel.app/guide/badges

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants