Add link support for all badges#1172
Conversation
Add link support to the following badges: - flat - flat-square - plastic Adjust social badge - if only 1 link supplied the whole badge will use that link - only use hover effects if badge contains a link
|
Thanks for looking into this. Have you made sense of the discussion in #598? This seems like it's the same fix. Does it patch around the Chrome bug somehow? |
|
The main difference is the I have basically just added this to the bottom of each template: {{?(it.links[0] && it.links[0].length)}}
<a xlink:href="{{=it.links[0]}}">
<rect width="{{=it.widths[0]}}" height="20" fill="rgba(0,0,0,0)"/>
</a>
{{?}}
{{?(it.links[0] && it.links[0].length || it.links[1] && it.links[1].length)}}
<a xlink:href="{{=it.links[1] || it.links[0]}}">
<rect x="{{=it.widths[0]}}" width="{{=it.widths[1]}}" height="20" fill="rgba(0,0,0,0)"/>
</a>
{{?}}which adds another |
|
One thing i have just realised: Examples:
Not sure why this is happening, |
|
Ah, right, the problem is in the server code, not the templates. Lines 3690 to 3696 in 14286e1 After this PR, can we turn on the links everywhere instead of limiting them to the social badges? When we do that, we should let the user-provided link(s) override the default ones in code. Basically we should handle it the same as the label. To see what I mean, take a look at the way we use Lines 54 to 56 in 14286e1 |
|
I feel like this is good to merge! Do you agree? Also, I wanted to ask: would you be interested in joining as a maintainer? You've shown a real interest in fixing some long-standing issues with the badge templates, developing powerful and flexible new badges, and fixing bugs here and there. It would be great to have your help reviewing contributions and contributing in whatever way you'd like. Would appreciate having you on board! |
|
Just wanted to follow up! Do you think this is ready to merge? Are you interested in being a maintainer? 😃 |
|
Yeah should be ready to merge, Thanks for the offer, |
Relates to:
#852
#598
closes #1079
Add link support to the following badges:
Adjust social badge
undefined)For all badges if only 1 link is supplied the whole badge will use that link
(currently no way to manually specify a second link)you can specify the second link usinglink=//firstlink.com&link=//secondlink.comAlso the only way i know of that a badge will show the links is if it is included via:
<object data="linktobadge.svg"/>