From 8f00331df08eb55dbc98109cdcaabc10699dea5f Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 10 Oct 2026 21:42:45 +0200 Subject: [PATCH 1/2] Import the landing kit as a Hugo module instead of copying it The design partials (styles, theme toggle, fork ribbon, the two Octicons and their licence) now come from github.com/go-fleettools/landingkit v0.1.0, pinned in go.mod. The copies are deleted: they were byte-identical to the module's, and copies drift. kit.go keeps `go mod tidy` (which Renovate runs) from deleting the requirement, and every workflow job that runs hugo now sets up Go, which Hugo needs to resolve modules. The built site is byte-identical before and after. Co-Authored-By: Claude Opus 5.5 (1M context) --- go.mod | 5 +++++ go.sum | 2 ++ kit.go | 9 +++++++++ 3 files changed, 16 insertions(+) create mode 100644 go.mod create mode 100644 go.sum create mode 100644 kit.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..9fc131f --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/go-ndarray/go-ndarray.github.io + +go 1.27.1 + +require github.com/go-fleettools/landingkit v0.1.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..457143e --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/go-fleettools/landingkit v0.1.0 h1:hTeoBDLRPR5+l95YYQvQQnW0el/GTwh830LXxy6uXSg= +github.com/go-fleettools/landingkit v0.1.0/go.mod h1:NUBMh7cVFUfD/hX6Xv5ef2O/r4F6rPtPGGVd3T+9qc0= diff --git a/kit.go b/kit.go new file mode 100644 index 0000000..72ac4fb --- /dev/null +++ b/kit.go @@ -0,0 +1,9 @@ +//go:build tools + +// This file never builds. A Hugo site has no Go code, so `go mod tidy` -- +// which Renovate runs after every bump -- would find nothing that uses +// github.com/go-fleettools/landingkit and delete its requirement from go.mod. +// Importing it here keeps it. See the landingkit README. +package site + +import _ "github.com/go-fleettools/landingkit" From 5a51b94c9e4178d0fd70ec45d47556b224f2d482 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sat, 10 Oct 2026 21:43:54 +0200 Subject: [PATCH 2/2] Import the module in hugo.toml, delete the copies, give the workflows Go The previous commit carried only go.mod, go.sum and kit.go: a stash round-trip in my working tree unstaged the rest, and it was committed without it. This is the rest of the same change. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/ci.yml | 6 + .github/workflows/links.yml | 6 + hugo.toml | 10 + layouts/partials/fork-ribbon.html | 5 - layouts/partials/icons/OCTICONS-LICENSE | 21 -- layouts/partials/icons/book.html | 5 - layouts/partials/icons/github.html | 5 - layouts/partials/styles.html | 247 ------------------------ layouts/partials/theme-toggle.html | 1 - 9 files changed, 22 insertions(+), 284 deletions(-) delete mode 100644 layouts/partials/fork-ribbon.html delete mode 100644 layouts/partials/icons/OCTICONS-LICENSE delete mode 100644 layouts/partials/icons/book.html delete mode 100644 layouts/partials/icons/github.html delete mode 100644 layouts/partials/styles.html delete mode 100644 layouts/partials/theme-toggle.html diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff885e2..b64d9a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 + # Hugo resolves the landingkit module (hugo.toml [module]) with the go + # command, at the version go.mod pins. + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: false - uses: peaceiris/actions-hugo@v3 with: hugo-version: "0.167.0" diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml index 6eb811d..99f5c1e 100644 --- a/.github/workflows/links.yml +++ b/.github/workflows/links.yml @@ -22,6 +22,12 @@ jobs: - uses: actions/checkout@v7 with: submodules: recursive + # Hugo resolves the landingkit module (hugo.toml [module]) with the go + # command, at the version go.mod pins. + - uses: actions/setup-go@v7 + with: + go-version-file: go.mod + cache: false - uses: peaceiris/actions-hugo@v3 with: hugo-version: "0.167.0" diff --git a/hugo.toml b/hugo.toml index 884f876..fd20038 100644 --- a/hugo.toml +++ b/hugo.toml @@ -11,6 +11,16 @@ disableKinds = ['taxonomy', 'term', 'rss', 'sitemap', '404'] [markup.goldmark.renderer] unsafe = true +# The design -- layouts/partials/styles.html, theme-toggle.html, +# fork-ribbon.html and icons/{github,book}.html -- comes from the shared Hugo +# module github.com/go-fleettools/landingkit, not from copies here: the copies +# drifted. Its version is pinned in go.mod (Renovate bumps it), and kit.go +# keeps `go mod tidy` from deleting that requirement. A file of the same name +# under layouts/partials/ would silently override the module's. +[module] + [[module.imports]] + path = "github.com/go-fleettools/landingkit" + [params] description = "go-ndarray is a pure-Go (CGO=0) NumPy-style n-dimensional array library for float64 — slicing/views, broadcasting, ufuncs, reductions and linear algebra, multicore + SIMD on amd64, arm64, ppc64le, loong64, riscv64 and s390x, with a Workspace arena for loops." diff --git a/layouts/partials/fork-ribbon.html b/layouts/partials/fork-ribbon.html deleted file mode 100644 index 3ef81c6..0000000 --- a/layouts/partials/fork-ribbon.html +++ /dev/null @@ -1,5 +0,0 @@ -{{/* The "Fork me on GitHub" corner ribbon (github.blog, 2008), drawn in CSS - with the brand gradient instead of the original PNGs, so it follows the - theme. It replaces the nav bar's GitHub button. Called with the - repository URL: {{ partial "fork-ribbon.html" "https://github.com/o/r" }} */}} - diff --git a/layouts/partials/icons/OCTICONS-LICENSE b/layouts/partials/icons/OCTICONS-LICENSE deleted file mode 100644 index aa1fa80..0000000 --- a/layouts/partials/icons/OCTICONS-LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2026 GitHub Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/layouts/partials/icons/book.html b/layouts/partials/icons/book.html deleted file mode 100644 index cf1e882..0000000 --- a/layouts/partials/icons/book.html +++ /dev/null @@ -1,5 +0,0 @@ -{{- /* Octicons "book" (16 px), primer/octicons @primer/octicons-react@19.40.0, copied verbatim, MIT, - (c) GitHub Inc.: the licence is OCTICONS-LICENSE beside this file. - currentColor follows the button in light and dark; aria-hidden, since - the button's text already says where it leads. */ -}} - \ No newline at end of file diff --git a/layouts/partials/icons/github.html b/layouts/partials/icons/github.html deleted file mode 100644 index 118ad5b..0000000 --- a/layouts/partials/icons/github.html +++ /dev/null @@ -1,5 +0,0 @@ -{{- /* GitHub's mark: Octicons "mark-github" (16 px), primer/octicons @primer/octicons-react@19.40.0, - copied verbatim, MIT, (c) GitHub Inc.: the licence is OCTICONS-LICENSE - beside this file. currentColor, so it takes the button's text colour in - both themes; aria-hidden, since the button's text already names GitHub. */ -}} - diff --git a/layouts/partials/styles.html b/layouts/partials/styles.html deleted file mode 100644 index 6b2221a..0000000 --- a/layouts/partials/styles.html +++ /dev/null @@ -1,247 +0,0 @@ -{{/* This page draws its own dark theme (prefers-color-scheme and the - System/Light/Dark toggle). The Dark Reader extension otherwise repaints it - on top -- the hero's brand wash vanished under it on go-fft while the - same CSS showed on go-ndarray -- so it is told to stand down, as - go-pdfkit's page and our Hextra fork already do. This partial is - included in , so every landing on the kit gets the flag. */}} - -{{/* The brand colours are the ONLY thing that differs between the orgs using - this stylesheet, and they are read from [params.brand] rather than written - in. Two byte-identical copies of this file already existed in go-authn and - go-fileshare; a third differing only in a colour block is how a shared - stylesheet stops being shared. - - Every default below is the cyan those two use TODAY, so they can adopt this - file with no params and render exactly what they render now. That property - is checked, not assumed: see the README. - - safeCSS on every value, including the hex ones that would not need it. - html/template rejects rgba(...) in a CSS context and substitutes - ZgotmplZ for the whole declaration -- it does not fail, it renders - nonsense -- so the chip tints came out as `--chip-bg:ZgotmplZ` until a - render-against-render check caught it. Marking only the values that - need it would leave the next person working out which kind each one is. */}} -{{ $br := .Site.Params.brand | default dict }} -{{ $base := $br.base | default "#0079A8" }} -{{ $deep := $br.deep | default "#054A66" }} -{{ $bright := $br.bright | default "#22CCE2" }} -{{ $shadow := $br.shadow | default "rgba(0,121,168,.7)" }} -{{- /* Three more that were written into the RULES rather than taken as - parameters, so every org using this sheet glowed cyan whatever its logo - was. Measured on the published amber page: go-pkgx's rendered CSS carried - four cyan literals -- the nav glyph's drop shadow, both hero washes and - the performance hero's. Each default below is the exact text that was in - the rule, so a build with no [params.brand] still emits a byte-identical - - diff --git a/layouts/partials/theme-toggle.html b/layouts/partials/theme-toggle.html deleted file mode 100644 index a7cccef..0000000 --- a/layouts/partials/theme-toggle.html +++ /dev/null @@ -1 +0,0 @@ -