From 007ea21c7af2192bc0820a0d4dd0ccd46741c7cf Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Thu, 14 Aug 2025 15:41:39 +0200 Subject: [PATCH 1/2] dev: update to Hextra v0.10.0 --- docs/assets/css/custom.css | 2 +- docs/content/_index.md | 10 ++-- docs/content/docs/_index.md | 17 +----- docs/content/docs/product/changelog.md | 4 +- docs/go.mod | 2 +- docs/go.sum | 4 +- docs/hugo.yaml | 4 +- docs/layouts/404.html | 14 ++--- docs/layouts/_partials/clickable-badge.html | 19 +++---- docs/layouts/_partials/custom-cards.html | 4 +- docs/layouts/_partials/custom/head-end.html | 2 +- docs/layouts/_partials/footer.html | 33 ++++------- .../_partials/utils/extract-headings.html | 31 ----------- docs/layouts/_partials/utils/fragments.html | 55 ------------------- docs/layouts/_shortcodes/button.html | 17 ++++++ docs/layouts/_shortcodes/clickable-badge.html | 2 +- docs/layouts/_shortcodes/custom-cards.html | 2 +- docs/layouts/_shortcodes/details.html | 10 ++-- docs/layouts/_shortcodes/filter-bar.html | 4 +- docs/layouts/_shortcodes/image-card.html | 2 +- docs/layouts/_shortcodes/item-settings.html | 6 +- docs/layouts/_shortcodes/starcharts.html | 14 +++++ 22 files changed, 89 insertions(+), 169 deletions(-) delete mode 100644 docs/layouts/_partials/utils/extract-headings.html delete mode 100644 docs/layouts/_partials/utils/fragments.html create mode 100644 docs/layouts/_shortcodes/button.html create mode 100644 docs/layouts/_shortcodes/starcharts.html diff --git a/docs/assets/css/custom.css b/docs/assets/css/custom.css index 9ba59d75935f..5faaa6320196 100644 --- a/docs/assets/css/custom.css +++ b/docs/assets/css/custom.css @@ -5,7 +5,7 @@ } /* Allow card subtitle with more than 3 lines */ -.hx-line-clamp-3.hextra-card-subtitle { +.hx\:line-clamp-3.hextra-card-subtitle { -webkit-line-clamp: 30; } diff --git a/docs/content/_index.md b/docs/content/_index.md index 63afecf747b7..22f896413bf6 100644 --- a/docs/content/_index.md +++ b/docs/content/_index.md @@ -7,25 +7,25 @@ params: {{< hextra/hero-container image="images/golangci-lint-logo-anim.gif" imageWidth="300" imageHeight="300" imageTitle="golangci-lint" >}} -
+
{{< hextra/hero-headline >}} Golangci-lint is a fast linters runner for Go {{< /hextra/hero-headline >}}
-
+
{{< hextra/hero-subtitle >}} - It runs linters in parallel, uses caching, supports YAML configuration, 
integrates with all major IDEs, and includes over a hundred linters. + It runs linters in parallel, uses caching, supports YAML configuration, 
integrates with all major IDEs, and includes over a hundred linters. {{< /hextra/hero-subtitle >}}
-
+
{{< hextra/hero-button text="Get Started" link="docs" >}}
{{< /hextra/hero-container >}} -
+
{{< hextra/feature-grid cols=3 >}} {{< hextra/feature-card diff --git a/docs/content/docs/_index.md b/docs/content/docs/_index.md index f557fee302df..479897a51dab 100644 --- a/docs/content/docs/_index.md +++ b/docs/content/docs/_index.md @@ -32,9 +32,7 @@ Golangci-lint is a free and open-source project built by volunteers. If you value it, consider supporting us, we appreciate it! -
-{{< hextra/hero-button text="Donate ❤️" link="/docs/donate" >}} -
+{{< button text="Donate ❤️" link="/docs/donate" >}} ## Contributors @@ -44,15 +42,4 @@ This project exists thanks to all the people who contribute. [How to contribute] ## Stargazers over time - - - - +{{< starcharts repo="golangci/golangci-lint" >}} diff --git a/docs/content/docs/product/changelog.md b/docs/content/docs/product/changelog.md index 044807b9c84c..ee1163450a7b 100644 --- a/docs/content/docs/product/changelog.md +++ b/docs/content/docs/product/changelog.md @@ -12,8 +12,6 @@ Follow the news and releases on [Mastodon](https://fosstodon.org/@golangcilint) If you value it, consider supporting us, we appreciate it! -
-{{< hextra/hero-button text="Donate ❤️" link="/docs/donate" >}} -
+{{< button text="Donate ❤️" link="/docs/donate" >}} {{% embed file=".tmp/raw_changelog.tmp" %}} diff --git a/docs/go.mod b/docs/go.mod index f7f6026cb626..5ff2f31d37b6 100644 --- a/docs/go.mod +++ b/docs/go.mod @@ -2,4 +2,4 @@ module github.com/golangci/docs go 1.23.0 -require github.com/imfing/hextra v0.9.7 // indirect +require github.com/imfing/hextra v0.10.0 // indirect diff --git a/docs/go.sum b/docs/go.sum index 8501da6f6aa2..c06bf6a75cf1 100644 --- a/docs/go.sum +++ b/docs/go.sum @@ -1,2 +1,2 @@ -github.com/imfing/hextra v0.9.7 h1:Zg5n24us36Bn/S/5mEUPkRW6uwE6vHHEqWSgN0bPXaM= -github.com/imfing/hextra v0.9.7/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI= +github.com/imfing/hextra v0.10.0 h1:dR0NEa6r/CF42xIq4WMbRqzUx8hsP1fQC39WrDYGEGk= +github.com/imfing/hextra v0.10.0/go.mod h1:cEfel3lU/bSx7lTE/+uuR4GJaphyOyiwNR3PTqFTXpI= diff --git a/docs/hugo.yaml b/docs/hugo.yaml index 38bb6c222b2b..800cf162e7c0 100644 --- a/docs/hugo.yaml +++ b/docs/hugo.yaml @@ -95,7 +95,7 @@ params: enable: true displayCopyright: false displayPoweredBy: true - width: normal + width: wide links: - title: Bluesky url: "https://bsky.app/profile/golangci-lint.run" @@ -158,3 +158,5 @@ params: page: # full (100%), wide (90rem), normal (80rem) width: full + tabs: + sync: false diff --git a/docs/layouts/404.html b/docs/layouts/404.html index 935601fb1999..3c97d0135b8e 100644 --- a/docs/layouts/404.html +++ b/docs/layouts/404.html @@ -1,20 +1,20 @@ {{ define "main" }} -
+
{{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" true) }} {{ partial "toc.html" . }} -
+
-
+ class="hx:w-full hx:min-w-0 hx:max-w-6xl hx:flex hx:flex-col hx:items-center hx:justify-center"> +
logo

+ class="not-prose hx:text-4xl font-bold leading-none tracking-tighter md:text-5xl py-2 bg-clip-text text-transparent bg-gradient-to-r from-gray-900 to-gray-600 dark:from-gray-100 dark:to-gray-400"> 404

-

+

The page could not be found.

- + Go to the home page
diff --git a/docs/layouts/_partials/clickable-badge.html b/docs/layouts/_partials/clickable-badge.html index 2244d4a4e048..a7ee3be3475e 100644 --- a/docs/layouts/_partials/clickable-badge.html +++ b/docs/layouts/_partials/clickable-badge.html @@ -1,4 +1,4 @@ -{{- /* Modified version of https://github.com/imfing/hextra/blob/v0.9.7/layouts/partials/shortcodes/badge.html */ -}} +{{- /* Modified version of https://github.com/imfing/hextra/blob/v0.10.0/layouts/_partials/shortcodes/badge.html */ -}} {{- /* Creates a badge with the given id and class. @@ -18,20 +18,17 @@ {{- $border := .border | default false -}} {{- $icon := .icon | default "" -}} -{{- $defaultClass := "hx-text-gray-600 hx-bg-gray-100 dark:hx-bg-neutral-800 dark:hx-text-neutral-200 hx-border-gray-200 dark:hx-border-neutral-700" -}} +{{- $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" -}} {{- $styleClass := newScratch -}} -{{- $styleClass.Set "info" "hx-border-blue-200 hx-bg-blue-100 hx-text-blue-900 dark:hx-border-blue-200/30 dark:hx-bg-blue-900/30 dark:hx-text-blue-200" -}} -{{- $styleClass.Set "warning" "hx-border-yellow-100 hx-bg-yellow-50 hx-text-yellow-900 dark:hx-border-yellow-200/30 dark:hx-bg-yellow-700/30 dark:hx-text-yellow-200" -}} -{{- $styleClass.Set "error" "hx-border-red-200 hx-bg-red-100 hx-text-red-900 dark:hx-border-red-200/30 dark:hx-bg-red-900/30 dark:hx-text-red-200" -}} -{{- $styleClass.Set "green" "hx-border-green-200 hx-bg-green-100 hx-text-green-900 dark:hx-border-green-200/30 dark:hx-bg-green-900/30 dark:hx-text-green-200" -}} -{{- $styleClass.Set "indigo" "hx-border-indigo-200 hx-bg-indigo-100 hx-text-indigo-900 dark:hx-border-indigo-200/30 dark:hx-bg-indigo-900/30 dark:hx-text-indigo-200" -}} -{{- $styleClass.Set "amber" "hx-border-amber-200 hx-bg-amber-100 hx-text-amber-900 dark:hx-border-amber-200/30 dark:hx-bg-amber-900/30 dark:hx-text-amber-200" -}} +{{- $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" -}} -{{- $borderClass := cond (eq $border true) "hx-border" "" -}} +{{- $borderClass := cond (eq $border true) "hx:border" "" -}} {{- $badgeClass := or ($styleClass.Get $type) $defaultClass -}} -
-
+
+
{{- with $icon -}}{{- partial "utils/icon" (dict "name" . "attributes" "height=12") -}}{{- end -}} {{- $content -}}
diff --git a/docs/layouts/_partials/custom-cards.html b/docs/layouts/_partials/custom-cards.html index 4dd8b2e44230..70c95597d5b7 100644 --- a/docs/layouts/_partials/custom-cards.html +++ b/docs/layouts/_partials/custom-cards.html @@ -1,8 +1,8 @@ -{{/* Modified version of https://github.com/imfing/hextra/blob/v0.9.7/layouts/partials/shortcodes/cards.html */}} +{{/* Modified version of https://github.com/imfing/hextra/blob/v0.10.0/layouts/_partials/shortcodes/cards.html */}} {{- $cols := .cols | default 3 -}} {{- $content := .content -}} {{- $mainClass := .mainClass | default "hextra-cards" -}} -
+
{{- $content -}}
diff --git a/docs/layouts/_partials/custom/head-end.html b/docs/layouts/_partials/custom/head-end.html index 59ab5ccbbd4c..bd4bc3514936 100644 --- a/docs/layouts/_partials/custom/head-end.html +++ b/docs/layouts/_partials/custom/head-end.html @@ -12,7 +12,7 @@ return } - const borderClass = 'hx-border' + const borderClass = 'hx:border' const hiddenClass = 'gl-hidden' document.querySelectorAll('.gl-filter').forEach(button => { diff --git a/docs/layouts/_partials/footer.html b/docs/layouts/_partials/footer.html index 3a81599a467a..52f24b1fd2a8 100644 --- a/docs/layouts/_partials/footer.html +++ b/docs/layouts/_partials/footer.html @@ -1,4 +1,4 @@ -{{- /* Modified version of https://github.com/imfing/hextra/blob/v0.9.7/layouts/partials/footer.html */ -}} +{{- /* Modified version of https://github.com/imfing/hextra/blob/v0.10.0/layouts/_partials/footer.html */ -}} {{- $enableFooterSwitches := .Scratch.Get "enableFooterSwitches" | default false -}} {{- $displayThemeToggle := site.Params.theme.displayToggle | default true -}} {{- $footerSwitchesVisible := and $enableFooterSwitches (or hugo.IsMultilingual $displayThemeToggle) -}} @@ -7,45 +7,36 @@ {{- $copyright := (T "copyright") | default "© 2024 Hextra." -}} {{- $poweredBy := (T "poweredBy") | default "Powered by Hextra" -}} -{{- $footerWidth := "hx-max-w-screen-xl" -}} -{{- with .Site.Params.footer.width -}} - {{ if eq . "wide" -}} - {{ $footerWidth = "hx-max-w-[90rem]" -}} - {{ else if eq . "full" -}} - {{ $footerWidth = "max-w-full" -}} - {{ end -}} -{{- end -}} - -