File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -248,3 +248,13 @@ footer.spi {
248248 text-align : center ;
249249 }
250250}
251+
252+ .badge {
253+ margin-left : 4px ;
254+ padding : 2px 4px ;
255+ font-size : 10px ;
256+ text-align : center ;
257+ color : var (--grey );
258+ background-color : var (--dark-grey );
259+ border-radius : 4px ;
260+ }
Original file line number Diff line number Diff line change @@ -172,7 +172,8 @@ struct DocumentationPageProcessor {
172172 . span(
173173 . class( referenceKind. cssClass) ,
174174 . text( docVersion. reference)
175- )
175+ ) ,
176+ latestBadge ( )
176177 ) , choices: documentationVersionChoices. count > 0 ? documentationVersionChoices : nil )
177178 ]
178179
@@ -244,6 +245,15 @@ struct DocumentationPageProcessor {
244245 ) . render ( )
245246 }
246247
248+ func latestBadge( ) -> Plot . Node < HTML . BodyContext > {
249+ let isLatest = availableVersions. first ( where: { $0. reference == docVersion. reference } ) ? . isLatestStable ?? false
250+ print ( " isLatest: \( isLatest) " )
251+ return isLatest ? . span(
252+ . class( " badge " ) ,
253+ . text( " LATEST " )
254+ ) : . empty
255+ }
256+
247257 var footer : String {
248258 @Dependency ( \. environment) var environment
249259 return Plot . Node. footer (
You can’t perform that action at this time.
0 commit comments