diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 0a02d2f..18e21f1 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -33,6 +33,13 @@ jobs: - name: Checkout 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 + - name: Set up Hugo uses: peaceiris/actions-hugo@v3 with: diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..f87cb40 --- /dev/null +++ b/go.mod @@ -0,0 +1,5 @@ +module github.com/go-pdfkit/go-pdfkit.github.io + +go 1.27.1 + +require github.com/go-fleettools/landingkit v0.2.0 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..decc912 --- /dev/null +++ b/go.sum @@ -0,0 +1,2 @@ +github.com/go-fleettools/landingkit v0.2.0 h1:p/LXzr65oSSr42Fvdk2PyWpyWxaCtUoRelNt2WSI4FI= +github.com/go-fleettools/landingkit v0.2.0/go.mod h1:NUBMh7cVFUfD/hX6Xv5ef2O/r4F6rPtPGGVd3T+9qc0= diff --git a/hugo.toml b/hugo.toml index 0d2f45b..7df321b 100644 --- a/hugo.toml +++ b/hugo.toml @@ -5,6 +5,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" + # The architectures the whole test suite RUNS on -- not the ones it compiles # for. amd64 and arm64 come from the ubuntu, windows and macOS runners; the # other six from the arch job, five under qemu and 386 natively. Listed here @@ -17,34 +27,24 @@ disableKinds = ["taxonomy", "term", "RSS", "sitemap", "404"] [params] arches = ["amd64", "arm64", "riscv64", "loong64", "ppc64le", "s390x", "386", "arm"] -# The shared stylesheet (layouts/partials/styles.html) is byte-identical to the -# one go-authn and go-fileshare carry; everything that differs between the orgs -# using it is here. The DARKER stop of the logo is the light-mode accent (it has -# to carry text on white), the BRIGHTER stop is the dark-mode one, and `deep` is -# a further step down for the gradient's far end. Both stops are read off -# static/img/logo.svg rather than chosen: #EF4444 -> #991B1B. [params.brand] - base = "#991B1B" # logo's darker stop — light-mode accent and gradient start - deep = "#7F1D1D" # a step darker again — gradient end - bright = "#EF4444" # logo's brighter stop — dark-mode accent - shadow = "rgba(153,27,27,.7)" # = base, for the primary button's drop shadow - # Chip tints: the BRIGHT stop mixed into white at 12 % and 30 %, the same - # derivation go-pkgx's amber uses — reproducing its committed #fef3e2 and - # #fce2b6 from #F59E0B is how that rule was confirmed rather than assumed. - chipBg = "#fde9e9" - chipBorder = "#fac7c7" - chipFg = "#7F1D1D" - chipBgDark = "rgba(239,68,68,.14)" +# Generated by go-fleettools/landingkit from static/img/logo.svg: the colours are +# READ from the logo's gradient, never chosen. Do not add other keys: +# neutrals (backgrounds, surfaces, greys) belong to the shared sheet. +# Contrast: base on white 8.31:1, bright on the dark background 5.13:1. + base = "#991b1b" + deep = "#5d1010" + bright = "#ef4444" + shadow = "rgba(153,27,27,.7)" + glow = "rgba(153,27,27,.6)" + wash = "rgba(153,27,27,.10)" + washDeep = "rgba(93,16,16,.06)" + chipBg = "#fde9e9" + chipBorder = "#fac7c7" + chipFg = "#5d1010" + chipBgDark = "rgba(239,68,68,.14)" chipBorderDark = "rgba(239,68,68,.32)" - chipFgDark = "#fca5a5" - # The three that used to be written into the rules: the nav glyph's drop - # shadow and the two hero washes. = base, base and deep. - glow = "rgba(153,27,27,.6)" - wash = "rgba(153,27,27,.10)" - washDeep = "rgba(127,29,29,.06)" - # Contrast, measured rather than eyeballed (WCAG 2.1, body-text bar is 4.5): - # #991B1B on #ffffff 8.31:1 AAA #EF4444 on #0b0e14 5.13:1 AA - # #7F1D1D on #fde9e9 8.59:1 AAA #fca5a5 on #0b0e14 10.18:1 AAA + chipFgDark = "#f69898" [[params.repos]] name = "reader" 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/index.html b/layouts/index.html index 1325b9c..e01c628 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -13,15 +13,8 @@ go-pdfkit logo go-pdfkit {{ partial "theme-toggle.html" . }} - {{/* GitHub's own mark, from Octicons (MIT) rather than drawn here: a - hand-traced logo is a wrong logo, and this fleet does not hand-draw - icons. aria-hidden because the word beside it already says what the - link is, and currentColor so it follows the button in both themes. - .btn is inline-flex with a gap, so it needs no rule of its own. */}} - - - GitHub + {{ partial "fork-ribbon.html" "https://github.com/go-pdfkit/pdfkit" }}
@@ -139,7 +132,7 @@

A subset, an encoding, and text you can still copy.

100 % statement coverage, including the branches that report a bad file.

And it runs on {{ len .Site.Params.arches }} architectures, not merely compiles for them. Pure Go, cgo disabled, BSD-3-Clause.

- {{ partial "icons/mark-github.html" . }}Read the source on GitHub → + {{ partial "icons/github.html" . }}Read the source on GitHub →
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/mark-github.html b/layouts/partials/icons/mark-github.html deleted file mode 100644 index 17fc355..0000000 --- a/layouts/partials/icons/mark-github.html +++ /dev/null @@ -1,5 +0,0 @@ -{{- /* 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 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/styles.html b/layouts/partials/styles.html deleted file mode 100644 index 97f1499..0000000 --- a/layouts/partials/styles.html +++ /dev/null @@ -1,236 +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 @@ -