Skip to content

Commit 00888f8

Browse files
committed
Display the version badge on crate list pages
Instead of the plain-text version number. This has the advantage of quickly showing pre-1.0 (orange) vs. post-1.0 (blue) when scanning down a list of crates. Since people might want to copy the version number of a crate from the crate list page, I've changed the alt text of the image to just be the version number that used to appear here, so that you can highlight the image and copy the version number.
1 parent ff45bd1 commit 00888f8

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

app/styles/crate.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@
117117
text-decoration: none;
118118
font-size: 120%;
119119
}
120-
.vers { margin-left: 10px; }
120+
.vers {
121+
margin-left: 10px;
122+
img {
123+
margin-bottom: -4px;
124+
}
125+
}
121126

122127
.stats {
123128
width: 15%;

app/templates/components/crate-row.hbs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<div class='desc'>
22
<div class='info'>
33
{{#link-to 'crate' crate.id}}{{ crate.name }}{{/link-to}}
4-
<span class='vers small'>{{ crate.max_version }}</span>
4+
<span class='vers'>
5+
<img
6+
src="https://img.shields.io/crates/v/{{ crate.name }}.svg"
7+
alt="{{ crate.max_version }}"
8+
title="{{ crate.name }}’s current version badge" />
9+
</span>
510
</div>
611
<div class='summary'>
712
<span class='small'>

0 commit comments

Comments
 (0)