Skip to content

Commit 9d94386

Browse files
components: add deprecated badge (#23744)
<!--Delete sections as needed --> ## Description Added gray color for deprecated badge. Updated contribution guide for usage ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [ ] Editorial review --------- Signed-off-by: Craig Osterhout <[email protected]> Co-authored-by: David Karlsson <[email protected]>
1 parent 1df786a commit 9d94386

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
{{- $colors := (dict
22
"amber" "bg-amber-500 dark:bg-amber-400"
33
"blue" "bg-blue-500 dark:bg-blue-400"
4+
"gray" "bg-gray-500 dark:bg-gray-400"
45
"green" "bg-green-500 dark:bg-green-700"
56
"red" "bg-red-500 dark:bg-red-400"
67
"violet" "bg-violet-500 dark:bg-violet-400"
78
)
89
-}}
910

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

1415

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

0 commit comments

Comments
 (0)