This also works for any links on shields.io, but I didn’t notice the Lemmy & Mastodon links before. Please share anything else you discover while experimenting. I’ll edit in more tips as people find them
Lemmy:
You can put the image markdown inside a link markdown
- Regular link:
[link_text](LINK_URL)
- Image link:
![](IMAGE_URL)
- All together:
[![](IMAGE_URL)](LINK_URL)
- Page to generate image: https://shields.io/badges/lemmy
Make sure to drop the domain from the link URL to make the button universal:
- for
https://lemmy.ca/c/canada
, use/c/canada .ca
- This will render with the correct domain in the user’s browser (ex.
https://example.com/c/[email protected]
)
For example:
[![](https://img.shields.io/lemmy/canada%40lemmy.ca?label=canada%40lemmy.ca&color=%239e090a&link=https%3A%2F%2Fexample.com
)](/c/Canada@lemmy.ca)
example post BEFORE: https://lemmy.ca/post/2890824
example post AFTER: https://lemmy.ca/post/2530982 (modified a few of the links)
Mastodon:
It’s listed on shields.io (link: https://shields.io/badges/mastodon-follow), but I had trouble getting it working. I’ll edit in instructions once I figure it out.
deleted by creator
Oh huh, I tried a number of combinations to get the universal link but I didn’t try that one. Thanks!
Poor bot probably can’t scan image links
Hi there! Looks like you linked to a Lemmy community using a URL instead of its name, which doesn’t work well for people on different instances. Try fixing it like this: [email protected]
deleted by creator
That’s a really nice use of shields.io
This is a cool feature and I like the way it looks. Is it possible to have it always link you using your current instance?
I haven’t played around with it much, and I was hoping this post would help figure some of these things out as people experiment
So far I could only get the hardlinks working, I think links like this ([email protected]) are handled by the frontend?
Update: @[email protected] fixed it, you just need to drop the domain from the link
for example
[![](image_link)](/c/Canada@lemmy.ca)