Skip to content

Commit 46f4880

Browse files
authored
dev: update Hextra to v0.11.0 (#6039)
1 parent 759ac47 commit 46f4880

File tree

10 files changed

+58
-28
lines changed

10 files changed

+58
-28
lines changed

docs/assets/css/custom.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,13 @@
4040
.hextra-footer .social-media :hover{
4141
transform: translateY(-2px);
4242
}
43+
44+
.hextra-banner {
45+
background: #6BB43A;
46+
background: linear-gradient(135deg, rgba(107, 180, 58, 1) 0%, rgba(29, 253, 253, 1) 50%, rgba(69, 145, 252, 1) 100%);
47+
color: var(--hx-color-slate-900);
48+
}
49+
50+
.extra-banner-close-button {
51+
color: var(--hx-color-slate-50);
52+
}

docs/content/docs/formatters/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ golangci-lint formatters
2828
## All formatters
2929

3030
{{< golangci/items/filter >}}
31-
{{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" type="warning" >}}
32-
{{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" type="info" >}}
33-
{{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" type="error" border=true >}}
31+
{{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" color="yellow" >}}
32+
{{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" color="blue" >}}
33+
{{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" color="red" border=true >}}
3434
{{< /golangci/items/filter >}}
3535

3636
{{< cards >}}

docs/content/docs/linters/_index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ golangci-lint linters
2828
## All Linters
2929

3030
{{< golangci/items/filter >}}
31-
{{< golangci/items/filter-badge class="gl-filter" data="default" icon="inbox" content="Default" type="info" >}}
32-
{{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" type="warning" >}}
33-
{{< golangci/items/filter-badge class="gl-filter" data="autofix" icon="sparkles" content="Autofix" type="info" >}}
31+
{{< golangci/items/filter-badge class="gl-filter" data="default" icon="inbox" content="Default" color="indigo" >}}
32+
{{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" color="yellow" >}}
33+
{{< golangci/items/filter-badge class="gl-filter" data="autofix" icon="sparkles" content="Autofix" color="blue" >}}
3434
{{< golangci/items/filter-badge class="gl-filter" data="fast" icon="fast-forward" content="Fast" >}}
3535
{{< golangci/items/filter-badge class="gl-filter" data="slow" icon="play" content="Slow" >}}
36-
{{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" type="info" >}}
37-
{{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" type="error" border=true >}}
36+
{{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" color="blue" >}}
37+
{{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" color="red" border=true >}}
3838
{{< /golangci/items/filter >}}
3939

4040
{{< cards >}}

docs/content/docs/plugins/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ weight: 7
44
---
55

66
{{< cards >}}
7-
{{< card link="/docs/plugins/module-plugins/" title="Module Plugin System" icon="puzzle" tag="Recommended" tagType="icon-only:sparkles" >}}
7+
{{< card link="/docs/plugins/module-plugins/" title="Module Plugin System" icon="puzzle" tag="Recommended" tagColor="icon-only:sparkles" >}}
88
{{< card link="/docs/plugins/go-plugins/" title="Go Plugin System" icon="puzzle" >}}
99
{{< /cards >}}

docs/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module github.com/golangci/docs
22

33
go 1.24.0
44

5-
require github.com/imfing/hextra v0.10.2 // indirect
5+
require github.com/imfing/hextra v0.11.0 // indirect

docs/go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/hugo.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ menu:
8282
params:
8383
description: Golangci-lint is a fast linters runner for Go.
8484

85+
banner:
86+
key: 'announcement-v2_4'
87+
message: |
88+
New golangci-lint release ([v2.4](/docs/product/changelog/)) with support of Go 1.25 🎉🎉🎉 It's time to [support us](/docs/donate/) to keep golangci-lint always up to date!
89+
8590
navbar:
8691
displayTitle: true
8792
displayLogo: true

docs/layouts/_partials/shortcodes/badge.html

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,48 @@
1-
{{- /* Modified version of https://github.com/imfing/hextra/blob/v0.10.0/layouts/_partials/shortcodes/badge.html */ -}}
1+
{{- /* Modified version of https://github.com/imfing/hextra/blob/v0.11.0/layouts/_partials/shortcodes/badge.html */ -}}
22
{{- /* This file overrides the badge partial of the theme */ -}}
33

44
{{- $content := .content -}}
5-
{{- $type := .type | default "" -}}
5+
{{- $color := .color | default .type | default "" -}}{{- /* Compatibility with previous parameter. */ -}}
66
{{- $class := .class | default "" -}}
77
{{- $border := .border | default false -}}
88
{{- $icon := .icon | default "" -}}
9-
{{- $data := .data | default "" -}}
109

11-
{{- $defaultClass := "hx:text-gray-600 hx:bg-gray-100 hx:dark:bg-neutral-800 hx:dark:text-neutral-200 hx:border-gray-200 hx:dark:border-neutral-700" -}}
10+
{{- /* Compatibility with previous names. */ -}}
11+
{{- $mapping := (dict
12+
"default" "gray"
13+
"tip" "green"
14+
"info" "blue"
15+
"warning" "yellow"
16+
"error" "red"
17+
"important" "purple"
18+
)
19+
-}}
20+
{{- $color = index $mapping $color | default $color | default "gray" -}}
1221

1322
{{- $styleClass := newScratch -}}
14-
{{- $styleClass.Set "info" "hx:border-blue-200 hx:bg-blue-100 hx:text-blue-900 hx:dark:border-blue-200/30 hx:dark:bg-blue-900/30 hx:dark:text-blue-200" -}}
15-
{{- $styleClass.Set "warning" "hx:border-yellow-100 hx:bg-yellow-50 hx:text-yellow-900 hx:dark:border-yellow-200/30 hx:dark:bg-yellow-700/30 hx:dark:text-yellow-200" -}}
16-
{{- $styleClass.Set "error" "hx:border-red-200 hx:bg-red-100 hx:text-red-900 hx:dark:border-red-200/30 hx:dark:bg-red-900/30 hx:dark:text-red-200" -}}
23+
{{- $styleClass.Set "gray" "hx:text-gray-600 hx:bg-gray-100 hx:dark:bg-neutral-800 hx:dark:text-neutral-200 hx:border-gray-200 hx:dark:border-neutral-700" -}}
24+
{{- $styleClass.Set "purple" "hx:border-purple-200 hx:bg-purple-100 hx:text-purple-900 hx:dark:border-purple-200/30 hx:dark:bg-purple-900/30 hx:dark:text-purple-200" -}}
25+
{{- $styleClass.Set "indigo" "hx:border-indigo-200 hx:bg-indigo-100 hx:text-indigo-900 hx:dark:border-indigo-200/30 hx:dark:bg-indigo-900/30 hx:dark:text-indigo-200" -}}
26+
{{- $styleClass.Set "blue" "hx:border-blue-200 hx:bg-blue-100 hx:text-blue-900 hx:dark:border-blue-200/30 hx:dark:bg-blue-900/30 hx:dark:text-blue-200" -}}
27+
{{- $styleClass.Set "green" "hx:border-green-200 hx:bg-green-100 hx:text-green-900 hx:dark:border-green-200/30 hx:dark:bg-green-900/30 hx:dark:text-green-200" -}}
28+
{{- $styleClass.Set "yellow" "hx:border-yellow-100 hx:bg-yellow-50 hx:text-yellow-900 hx:dark:border-yellow-200/30 hx:dark:bg-yellow-700/30 hx:dark:text-yellow-200" -}}
29+
{{- $styleClass.Set "orange" "hx:border-orange-100 hx:bg-orange-50 hx:text-orange-800 hx:dark:border-orange-400/30 hx:dark:bg-orange-400/20 hx:dark:text-orange-300" -}}
30+
{{- $styleClass.Set "amber" "hx:border-amber-200 hx:bg-amber-100 hx:text-amber-900 hx:dark:border-amber-200/30 hx:dark:bg-amber-900/30 hx:dark:text-amber-200" -}}
31+
{{- $styleClass.Set "red" "hx:border-red-200 hx:bg-red-100 hx:text-red-900 hx:dark:border-red-200/30 hx:dark:bg-red-900/30 hx:dark:text-red-200" -}}
1732

1833
{{- $borderClass := cond (eq $border true) "hx:border" "" -}}
19-
{{- $badgeClass := or ($styleClass.Get $type) $defaultClass -}}
34+
{{- $badgeClass := or ($styleClass.Get $color) ($styleClass.Get "gray") -}}
2035

2136
{{- /* Custom section to handle icon-only badges. */ -}}
22-
{{- $iconOnly := hasPrefix $type "icon-only" -}}
37+
{{- $iconOnly := hasPrefix $color "icon-only" -}}
2338
{{- if $iconOnly -}}
24-
{{- $icon = (strings.TrimPrefix "icon-only:" $type) -}}
39+
{{- $icon = (strings.TrimPrefix "icon-only:" $color) -}}
2540
{{- $borderClass = "" -}}
26-
{{- $defaultClass = "" -}}
2741
{{- $badgeClass = "hx:p-2" -}}
2842
{{- end -}}
2943

3044
{{- /* Custom section to set attributes. */ -}}
45+
{{- $data := .data | default "" -}}
3146
{{- $attributes := slice -}}
3247
{{- if $iconOnly -}}
3348
{{- $attributes = $attributes | append (printf `title="%s"` $content) -}}

docs/layouts/_shortcodes/golangci/items/filter-badge.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/}}
1414

1515
{{- $content := .Get "content" -}}
16-
{{- $type := .Get "type" | default "" -}}
16+
{{- $color := .Get "color" | default "" -}}
1717
{{- $data := .Get "data" | default "" -}}
1818
{{- $class := .Get "class" | default "" -}}
1919
{{- $icon := .Get "icon" | default "" -}}
@@ -23,7 +23,7 @@
2323
"data" $data
2424
"class" (printf "hx:mt-2 hx:mx-1 hx:cursor-pointer %s" $class)
2525
"content" $content
26-
"type" $type
26+
"color" $color
2727
"border" $border
2828
"icon" $icon
2929
)

docs/layouts/_shortcodes/golangci/items/settings.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"icon" "sparkles"
4848
"class" "hx:mx-1"
4949
"content" (print "Deprecated since " .deprecation.since)
50-
"type" "error"
50+
"color" "red"
5151
)
5252
}}
5353
{{ else }}
@@ -57,7 +57,7 @@
5757
"icon" "sparkles"
5858
"class" "hx:mx-1"
5959
"content" "New"
60-
"type" "warning"
60+
"color" "yellow"
6161
)
6262
}}
6363
{{ end }}
@@ -67,7 +67,7 @@
6767
"icon" "sparkles"
6868
"class" "hx:mx-1"
6969
"content" "Autofix"
70-
"type" "info"
70+
"color" "blue"
7171
)
7272
}}
7373
{{ end }}

0 commit comments

Comments
 (0)