Skip to content

Commit 89610e6

Browse files
components: add deprecated badge
Signed-off-by: Craig Osterhout <[email protected]>
1 parent c152b60 commit 89610e6

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

content/contribute/components/badges.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,41 @@ toc_max: 3
1111
{{< badge color=red text="red badge" >}}
1212
{{< badge color=green text="green badge" >}}
1313
{{< badge color=violet text="violet badge" >}}
14+
{{< badge color=gray text="gray badge" >}}
1415

1516
You can also make a badge a link.
1617

1718
[{{< badge color="blue" text="badge with a link" >}}](../_index.md)
1819

1920
### Usage guidelines
2021

21-
We use badges to indicate new content and product content in various stages of the release lifecycle:
22+
Use badges to indicate new content and product content in various stages of the release lifecycle:
2223

23-
- The violet badge to highlight new early access or experimental content
24-
- The blue badge to highlight beta content
24+
- The violet badge to highlight new early access or experimental content
25+
- The blue badge to highlight beta content
2526
- The green badge to highlight new content that is either GA or not product-related content, such as guides/learning paths
27+
- The gray badge to highlight deprecated content
2628

2729
Best practice is to use this badge for no longer than 2 months post release of the feature.
2830

2931
### Markup
3032

33+
Inline badge:
34+
3135
```go
3236
{{</* badge color=amber text="amber badge" */>}}
3337
[{{</* badge color="blue" text="badge with a link" */>}}](../overview.md)
3438
```
39+
40+
Sidebar badge in frontmatter:
41+
42+
```yaml
43+
---
44+
title: Page title
45+
params:
46+
sidebar:
47+
badge:
48+
color: gray
49+
text: Deprecated
50+
---
51+
```
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
layouts/partials/components/badge.html
12
{{- $colors := (dict
23
"amber" "bg-amber-500 dark:bg-amber-400"
34
"blue" "bg-blue-500 dark:bg-blue-400"
5+
"gray" "bg-gray-500 dark:bg-gray-400"
46
"green" "bg-green-500 dark:bg-green-700"
57
"red" "bg-red-500 dark:bg-red-400"
68
"violet" "bg-violet-500 dark:bg-violet-400"
79
)
810
-}}
911

1012
{{- if not (isset $colors .color) -}}
11-
{{- errorf "[badge] wrong color name: '%s' - supported values: amber, blue, green, red, violet" .color -}}h
13+
{{- errorf "[badge] wrong color name: '%s' - supported values: amber, blue, gray, green, red, violet" .color -}}h
1214
{{- end -}}
1315

1416

1517
<span
1618
class="not-prose {{ index $colors .color }} rounded-sm px-1 text-xs text-white"
17-
>{{ .content }}</span
18-
>
19+
>{{ .content }}
20+
</span>

0 commit comments

Comments
 (0)