Skip to content

Import the landing kit as a Hugo module instead of copying it - #34

Merged
tannevaled merged 2 commits into
mainfrom
import-landingkit
Oct 10, 2026
Merged

tannevaled merged 2 commits into
mainfrom
import-landingkit

Conversation

@tannevaled

@tannevaled tannevaled commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

The design partials now come from the Hugo module go-fleettools/landingkit v0.1.0 instead of copies here. The copies were byte-identical to the module's (styles.html md5 750222ab…, and the same for the other five files), and copies drift: six landings already carry a variant stylesheet.

What changes

  • hugo.toml: [module] [[module.imports]] path = "github.com/go-fleettools/landingkit", with a comment.
  • go.mod / go.sum: pin github.com/go-fleettools/landingkit v0.1.0. Hugo resolves modules with the go command, and Renovate will propose the bumps.
  • kit.go: a //go:build tools file that imports the module and never builds. Without it, go mod tidy deletes the requirement because no Go code uses it; I measured this on landingkit's example. The org's Renovate preset runs gomodTidy after every update, and the grouped branch auto-merges, so the first bump would have removed the module.
  • Deleted: layouts/partials/{styles,theme-toggle,fork-ribbon}.html, icons/{github,book}.html, icons/OCTICONS-LICENSE (the licence ships with the module).
  • Kept: icons/play.html, which is this site's own. Site partials still take precedence over the module's.
  • Workflows: ci.yml, links.yml now run actions/setup-go (go-version-file: go.mod) before Hugo, in the jobs that had no Go.

Proof: the built site is byte-identical

I built fresh clones of main and of this pushed branch (based on current main) the way the workflows do, then ran diff -r on the output:

build files result
hugo 0.167.0 5 identical
hugo --minify 0.167.0 (ci, links) 5 identical
hugo --gc --minify --baseURL … 0.135.0 (deploy) 5 identical

Negative control (run on go-widgets, same change): with the partials deleted and the [module] import removed, the build fails. With the import, it is identical to main. So the module really is where the partials now come from. hugo mod graph shows github.com/go-fleettools/landingkit@v0.1.0.

The playground

playground/ is a nested Go module with its own go.mod, so the new root go.mod does not include it, and none of its files change. On this branch it still vets, its tests pass, and the js/wasm build succeeds. With VCS stamping off (-buildvcs=false), the wasm built on this branch is byte-identical to the one built on main. With stamping on, they differ only by vcs.modified on my uncommitted working tree, which proves nothing either way. hugo.yml and playground.yml already set up Go.

🤖 Generated with Claude Code

tannevaled and others added 2 commits October 10, 2026 21:42
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
@tannevaled
tannevaled merged commit fad8d9c into main Oct 10, 2026
7 checks passed
@tannevaled
tannevaled deleted the import-landingkit branch October 10, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant