diff --git a/docs/assets/css/custom.css b/docs/assets/css/custom.css index 9cf1e458f8b6..c11634e73036 100644 --- a/docs/assets/css/custom.css +++ b/docs/assets/css/custom.css @@ -40,3 +40,13 @@ .hextra-footer .social-media :hover{ transform: translateY(-2px); } + +.hextra-banner { + background: #6BB43A; + background: linear-gradient(135deg, rgba(107, 180, 58, 1) 0%, rgba(29, 253, 253, 1) 50%, rgba(69, 145, 252, 1) 100%); + color: var(--hx-color-slate-900); +} + +.extra-banner-close-button { + color: var(--hx-color-slate-50); +} diff --git a/docs/content/docs/formatters/_index.md b/docs/content/docs/formatters/_index.md index 8ceef54fa35e..9e7e7939455b 100644 --- a/docs/content/docs/formatters/_index.md +++ b/docs/content/docs/formatters/_index.md @@ -28,9 +28,9 @@ golangci-lint formatters ## All formatters {{< golangci/items/filter >}} - {{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" type="warning" >}} - {{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" type="info" >}} - {{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" type="error" border=true >}} + {{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" color="yellow" >}} + {{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" color="blue" >}} + {{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" color="red" border=true >}} {{< /golangci/items/filter >}} {{< cards >}} diff --git a/docs/content/docs/linters/_index.md b/docs/content/docs/linters/_index.md index 951408b20bf3..61dc1c471626 100644 --- a/docs/content/docs/linters/_index.md +++ b/docs/content/docs/linters/_index.md @@ -28,13 +28,13 @@ golangci-lint linters ## All Linters {{< golangci/items/filter >}} - {{< golangci/items/filter-badge class="gl-filter" data="default" icon="inbox" content="Default" type="info" >}} - {{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" type="warning" >}} - {{< golangci/items/filter-badge class="gl-filter" data="autofix" icon="sparkles" content="Autofix" type="info" >}} + {{< golangci/items/filter-badge class="gl-filter" data="default" icon="inbox" content="Default" color="indigo" >}} + {{< golangci/items/filter-badge class="gl-filter" data="new" icon="fire" content="New" color="yellow" >}} + {{< golangci/items/filter-badge class="gl-filter" data="autofix" icon="sparkles" content="Autofix" color="blue" >}} {{< golangci/items/filter-badge class="gl-filter" data="fast" icon="fast-forward" content="Fast" >}} {{< golangci/items/filter-badge class="gl-filter" data="slow" icon="play" content="Slow" >}} - {{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" type="info" >}} - {{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" type="error" border=true >}} + {{< golangci/items/filter-badge class="gl-filter" data="deprecated" icon="emoji-sad" content="Deprecated" color="blue" >}} + {{< golangci/items/filter-badge class="gl-filter-reset gl-hidden" icon="trash" content="Reset" color="red" border=true >}} {{< /golangci/items/filter >}} {{< cards >}} diff --git a/docs/content/docs/plugins/_index.md b/docs/content/docs/plugins/_index.md index 401ab525228a..3995aa280871 100644 --- a/docs/content/docs/plugins/_index.md +++ b/docs/content/docs/plugins/_index.md @@ -4,6 +4,6 @@ weight: 7 --- {{< cards >}} - {{< card link="/docs/plugins/module-plugins/" title="Module Plugin System" icon="puzzle" tag="Recommended" tagType="icon-only:sparkles" >}} + {{< card link="/docs/plugins/module-plugins/" title="Module Plugin System" icon="puzzle" tag="Recommended" tagColor="icon-only:sparkles" >}} {{< card link="/docs/plugins/go-plugins/" title="Go Plugin System" icon="puzzle" >}} {{< /cards >}} diff --git a/docs/go.mod b/docs/go.mod index d7398b692129..3c6d365fef03 100644 --- a/docs/go.mod +++ b/docs/go.mod @@ -2,4 +2,4 @@ module github.com/golangci/docs go 1.24.0 -require github.com/imfing/hextra v0.10.2 // indirect +require github.com/imfing/hextra v0.11.0 // indirect diff --git a/docs/go.sum b/docs/go.sum index 85669f9d09e0..33a9e6bc5556 100644 --- a/docs/go.sum +++ b/docs/go.sum @@ -1,2 +1,2 @@ -github.com/imfing/hextra v0.10.2 h1:etVtBSHH3V4xYZ2uqlh7HWZitdaZLWG+sCoGtFqyAEk= -github.com/imfing/hextra v0.10.2/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI= +github.com/imfing/hextra v0.11.0 h1:2HswtfKD/TFg2VWp0hvsH5F3/WoEugiz8s3n2JFouqY= +github.com/imfing/hextra v0.11.0/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI= diff --git a/docs/hugo.yaml b/docs/hugo.yaml index 116a6e30bac5..23edf99a0c3d 100644 --- a/docs/hugo.yaml +++ b/docs/hugo.yaml @@ -82,6 +82,11 @@ menu: params: description: Golangci-lint is a fast linters runner for Go. + banner: + key: 'announcement-v2_4' + message: | + 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! + navbar: displayTitle: true displayLogo: true diff --git a/docs/layouts/_partials/shortcodes/badge.html b/docs/layouts/_partials/shortcodes/badge.html index ef4ed96a979d..1c783ceaf7a9 100644 --- a/docs/layouts/_partials/shortcodes/badge.html +++ b/docs/layouts/_partials/shortcodes/badge.html @@ -1,33 +1,48 @@ -{{- /* Modified version of https://github.com/imfing/hextra/blob/v0.10.0/layouts/_partials/shortcodes/badge.html */ -}} +{{- /* Modified version of https://github.com/imfing/hextra/blob/v0.11.0/layouts/_partials/shortcodes/badge.html */ -}} {{- /* This file overrides the badge partial of the theme */ -}} {{- $content := .content -}} -{{- $type := .type | default "" -}} +{{- $color := .color | default .type | default "" -}}{{- /* Compatibility with previous parameter. */ -}} {{- $class := .class | default "" -}} {{- $border := .border | default false -}} {{- $icon := .icon | default "" -}} -{{- $data := .data | default "" -}} -{{- $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" -}} +{{- /* Compatibility with previous names. */ -}} +{{- $mapping := (dict + "default" "gray" + "tip" "green" + "info" "blue" + "warning" "yellow" + "error" "red" + "important" "purple" + ) +-}} +{{- $color = index $mapping $color | default $color | default "gray" -}} {{- $styleClass := newScratch -}} -{{- $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" -}} -{{- $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" -}} -{{- $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" -}} +{{- $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" -}} +{{- $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" -}} +{{- $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" -}} +{{- $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" -}} +{{- $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" -}} +{{- $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" -}} +{{- $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" -}} +{{- $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" -}} +{{- $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" -}} {{- $borderClass := cond (eq $border true) "hx:border" "" -}} -{{- $badgeClass := or ($styleClass.Get $type) $defaultClass -}} +{{- $badgeClass := or ($styleClass.Get $color) ($styleClass.Get "gray") -}} {{- /* Custom section to handle icon-only badges. */ -}} -{{- $iconOnly := hasPrefix $type "icon-only" -}} +{{- $iconOnly := hasPrefix $color "icon-only" -}} {{- if $iconOnly -}} - {{- $icon = (strings.TrimPrefix "icon-only:" $type) -}} + {{- $icon = (strings.TrimPrefix "icon-only:" $color) -}} {{- $borderClass = "" -}} - {{- $defaultClass = "" -}} {{- $badgeClass = "hx:p-2" -}} {{- end -}} {{- /* Custom section to set attributes. */ -}} +{{- $data := .data | default "" -}} {{- $attributes := slice -}} {{- if $iconOnly -}} {{- $attributes = $attributes | append (printf `title="%s"` $content) -}} diff --git a/docs/layouts/_shortcodes/golangci/items/filter-badge.html b/docs/layouts/_shortcodes/golangci/items/filter-badge.html index ee24af4a0db8..956f99f5993d 100644 --- a/docs/layouts/_shortcodes/golangci/items/filter-badge.html +++ b/docs/layouts/_shortcodes/golangci/items/filter-badge.html @@ -13,7 +13,7 @@ */}} {{- $content := .Get "content" -}} -{{- $type := .Get "type" | default "" -}} +{{- $color := .Get "color" | default "" -}} {{- $data := .Get "data" | default "" -}} {{- $class := .Get "class" | default "" -}} {{- $icon := .Get "icon" | default "" -}} @@ -23,7 +23,7 @@ "data" $data "class" (printf "hx:mt-2 hx:mx-1 hx:cursor-pointer %s" $class) "content" $content - "type" $type + "color" $color "border" $border "icon" $icon ) diff --git a/docs/layouts/_shortcodes/golangci/items/settings.html b/docs/layouts/_shortcodes/golangci/items/settings.html index 177f9ff0c40c..310dc0ede275 100644 --- a/docs/layouts/_shortcodes/golangci/items/settings.html +++ b/docs/layouts/_shortcodes/golangci/items/settings.html @@ -47,7 +47,7 @@ "icon" "sparkles" "class" "hx:mx-1" "content" (print "Deprecated since " .deprecation.since) - "type" "error" + "color" "red" ) }} {{ else }} @@ -57,7 +57,7 @@ "icon" "sparkles" "class" "hx:mx-1" "content" "New" - "type" "warning" + "color" "yellow" ) }} {{ end }} @@ -67,7 +67,7 @@ "icon" "sparkles" "class" "hx:mx-1" "content" "Autofix" - "type" "info" + "color" "blue" ) }} {{ end }}