Skip to content

Commit de3b816

Browse files
authored
docs: fix filter bar items (#5990)
1 parent aa726dc commit de3b816

File tree

4 files changed

+28
-18
lines changed

4 files changed

+28
-18
lines changed

docs/content/docs/formatters/_index.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ golangci-lint formatters
2525

2626
## All formatters
2727

28-
<div class="hx-mt-6">
29-
{{< icon "filter" >}}
30-
{{< clickable-badge icon="fire" id="new-filter" content="New" class="gl-filter hx-cursor-pointer" type="warning" border=false >}}
31-
{{< clickable-badge icon="emoji-sad" id="deprecated-filter" content="Deprecated" class="gl-filter hx-cursor-pointer" type="info" border=false >}}
32-
{{< clickable-badge icon="trash" id="reset-filter" content="Reset" class="gl-filter-reset gl-hidden hx-cursor-pointer" type="error" border=true >}}
33-
</div>
28+
{{< filter-bar >}}
29+
{{< clickable-badge class="gl-filter" id="new-filter" icon="fire" content="New" type="warning" >}}
30+
{{< clickable-badge class="gl-filter" id="deprecated-filter" icon="emoji-sad" content="Deprecated" type="info" >}}
31+
{{< clickable-badge class="gl-filter-reset gl-hidden" id="reset-filter" icon="trash" content="Reset" type="error" border=true >}}
32+
{{< /filter-bar >}}
3433

3534
{{< cards >}}
3635
{{< item-cards path="formatters" data="formatters_info" >}}

docs/content/docs/linters/_index.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@ golangci-lint linters
2525

2626
## All Linters
2727

28-
<div class="hx-mt-6">
29-
{{< icon "filter" >}}
30-
{{< clickable-badge icon="inbox" id="default-filter" content="Default" class="gl-filter hx-cursor-pointer" type="info" border=false >}}
31-
{{< clickable-badge icon="fire" id="new-filter" content="New" class="gl-filter hx-cursor-pointer" type="warning" border=false >}}
32-
{{< clickable-badge icon="sparkles" id="autofix-filter" content="Autofix" class="gl-filter hx-cursor-pointer" type="info" border=false >}}
33-
{{< clickable-badge icon="fast-forward" id="fast-filter" content="Fast" class="gl-filter hx-cursor-pointer" border=false >}}
34-
{{< clickable-badge icon="play" id="slow-filter" content="Slow" class="gl-filter hx-cursor-pointer" border=false >}}
35-
{{< clickable-badge icon="emoji-sad" id="deprecated-filter" content="Deprecated" class="gl-filter hx-cursor-pointer" type="info" border=false >}}
36-
{{< clickable-badge icon="trash" id="reset-filter" content="Reset" class="gl-filter-reset gl-hidden hx-cursor-pointer" type="error" border=true >}}
37-
</div>
28+
{{< filter-bar >}}
29+
{{< clickable-badge class="gl-filter" id="default-filter" icon="inbox" content="Default" type="info" >}}
30+
{{< clickable-badge class="gl-filter" id="new-filter" icon="fire" content="New" type="warning" >}}
31+
{{< clickable-badge class="gl-filter" id="autofix-filter" icon="sparkles" content="Autofix" type="info" >}}
32+
{{< clickable-badge class="gl-filter" id="fast-filter" icon="fast-forward" content="Fast" >}}
33+
{{< clickable-badge class="gl-filter" id="slow-filter" icon="play" content="Slow" >}}
34+
{{< clickable-badge class="gl-filter" id="deprecated-filter" icon="emoji-sad" content="Deprecated" type="info" >}}
35+
{{< clickable-badge class="gl-filter-reset gl-hidden" icon="trash" id="reset-filter" content="Reset" type="error" border=true >}}
36+
{{< /filter-bar >}}
3837

3938
{{< cards >}}
4039
{{< item-cards path="linters" data="linters_info" >}}

docs/layouts/_partials/clickable-badge.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131
{{- $borderClass := cond (eq $border true) "hx-border" "" -}}
3232
{{- $badgeClass := or ($styleClass.Get $type) $defaultClass -}}
33-
<div class="hextra-badge hx-mt-2">
34-
<div id="{{ $id }}" class="hx-inline-flex hx-gap-1 hx-items-center hx-rounded-full hx-px-2.5 hx-leading-6 hx-text-[.65rem] {{ $borderClass }} {{ $badgeClass }} {{ $class }}">
33+
<div class="hextra-badge hx-mt-2 hx-mx-1">
34+
<div id="{{ $id }}" class="hx-inline-flex hx-gap-1 hx-items-center hx-rounded-full hx-px-2.5 hx-leading-6 hx-text-[.65rem] hx-cursor-pointer {{ $borderClass }} {{ $badgeClass }} {{ $class }}">
3535
{{- with $icon -}}{{- partial "utils/icon" (dict "name" . "attributes" "height=12") -}}{{- end -}}
3636
{{- $content -}}
3737
</div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- /*
2+
This shortcode is used to create a filter bar.
3+
4+
@example {{< filter-bar >}}{{< clickable-badge content="Example">}}{{< filter-bar >}}
5+
*/ -}}
6+
7+
<div class="hx-mt-6">
8+
<span class="hx-inline-block hx-align-text-bottom icon" title="Filter">
9+
{{- partial "utils/icon.html" (dict "name" "filter" "attributes" "height=1.2em") -}}
10+
</span>
11+
{{ .Inner }}
12+
</div>

0 commit comments

Comments
 (0)