Skip to content

Commit 9647e2d

Browse files
committed
content/static: add badges to the version page
Adds badges for deprecated major versions and retracted versions on the versions page. For golang/go#41321 For golang/go#43265 Change-Id: Ia7194cb6ef1efeb67d452844f4e40c39d7a7ffa9 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307849 Trust: Jamal Carvalho <[email protected]> Reviewed-by: Julie Qiu <[email protected]>
1 parent b3344a7 commit 9647e2d

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

content/static/css/versions.css

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
}
4646
}
4747
.Version-major {
48+
align-items: baseline;
49+
display: flex;
4850
margin-bottom: 1rem;
4951
min-width: 4rem;
5052
}
@@ -83,26 +85,31 @@
8385
color: var(--turq-dark);
8486
}
8587
.Version-commitTime {
88+
align-items: center;
89+
display: flex;
8690
margin-left: 1rem;
8791
white-space: nowrap;
8892
}
8993
.Version-details {
9094
line-height: 1.25rem;
91-
margin-left: -0.5rem;
9295
}
9396
.Version-summary {
9497
align-items: center;
9598
cursor: pointer;
96-
display: flex;
9799
line-height: 2.25rem;
98100
padding-right: 0.5rem;
99101
white-space: nowrap;
100102
width: min-content;
101103
}
102-
details.Version-details img {
103-
position: relative;
104-
top: 0.0625rem;
105-
}
106-
details.Version-details[open] img {
107-
transform: rotate(90deg);
104+
105+
.Version-badge {
106+
border: 0.0625rem solid var(--gray-4);
107+
border-radius: 0.125rem;
108+
font-size: 0.6875rem;
109+
font-weight: 500;
110+
line-height: 1rem;
111+
margin-left: 0.5rem;
112+
margin-top: 0.125rem;
113+
padding: 0 0.35rem;
114+
text-align: center;
108115
}

content/static/html/helpers/_versions.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,20 @@
3737
{{range $i, $v := $major.Versions}}
3838
<div class="Version-major">
3939
{{if and (eq $i 0) (not $major.Incompatible)}}
40-
<strong>{{$major.Major}}</strong>
41-
<div>{{if $major.Deprecated}}(Deprecated{{with $major.DeprecationComment}}: {{.}}{{end}}){{end}}</div>
40+
<strong>{{$major.Major}}</strong>
41+
{{if true}}<span class="Version-badge">deprecated</span>{{end}}
4242
{{end}}
4343
</div>
4444
<div class="Version-tag">
4545
<a class="js-versionLink" href="{{$v.Link}}">{{$v.Version}}</a>
46-
<div>{{if $v.Retracted}}(Retracted{{with $v.RetractionRationale}}: {{.}}{{end}}){{end}}</div>
4746
</div>
4847
<div class="Version-dot{{if and $v.IsMinor (not $major.Incompatible)}} Version-dot--minor{{end}}"></div>
4948
{{if and $v.Symbols (not $major.Incompatible)}}
5049
{{template "symbol_history" $v}}
5150
{{else}}
52-
<div class="Version-commitTime">{{$v.CommitTime}}</div>
51+
<div class="Version-commitTime">
52+
{{$v.CommitTime}}{{if $v.Retracted}}<span class="Version-badge">retracted</span>{{end}}
53+
</div>
5354
{{end}}
5455
{{end}}
5556
{{end}}
@@ -59,8 +60,7 @@
5960
{{define "symbol_history"}}
6061
<details class="Version-details js-versionDetails">
6162
<summary class="Version-summary">
62-
<img alt="" height="24" width="24" src="/static/img/pkg-icon-arrowRight_24x24.svg">
63-
{{.CommitTime}}
63+
{{.CommitTime}}{{if .Retracted}}<span class="Version-badge">retracted</span>{{end}}
6464
</summary>
6565
<div class="Versions-symbols">
6666
<div class="Versions-symbolsHeader">Changes in this version</div>

0 commit comments

Comments
 (0)