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/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/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/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" 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" }} */}} -
Fork me on GitHub
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 @@ -