Skip to content

Move the docs to Hugo + Hextra, built like go-fileshare/docs - #27

Merged
tannevaled merged 2 commits into
mainfrom
hugo-hextra
Oct 9, 2026
Merged

tannevaled merged 2 commits into
mainfrom
hugo-hextra

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

What

The documentation site moves from MkDocs Material + mike to Hugo + the tannevaled/hextra fork, built the same way as go-fileshare/docs:

  • themes/hextra submodule pinned at v0.16.0 (the tag go-fileshare uses); branding submodule = go-ndarray/brand (mark, favicons, PNGs).
  • hugo.yaml: navbar version › theme › search › GitHub, related-sites menu (landing, playground), page subtitle + history, darkreaderLock, flexsearch.
  • Brand colours from the mark's gradient: #047857 (light) / #34D399 (dark) as Hextra's primary, in assets/css/custom.css (the MkDocs site used Material's green).
  • content/en/ (English only, ready for more languages), i18n/en.yaml.
  • layouts/_partials/custom/version-select.html and scripts/publish-version.sh from go-fileshare; versions.json stays in mike's format, latest is a symlink, the root redirects to latest/.
  • .github/workflows/docs.yml: Hugo 0.167.0 pinned by sha256, page-history script from the theme, --panicOnWarning build, offline lychee link/anchor check, an external-link job, and a deploy job (main only, gh-pages-deploy concurrency group, no force push) that replaces only its own version directory.

Versions

The version label is now ndarray's MAJOR.MINOR, read from params.ndarray.version: v0.9.1 → /docs/0.9/, and latest moves to it. MkDocs kept publishing the content as 0.2 although the library is at v0.9.1. 0.1/ and 0.2/ on gh-pages are not touched and stay listed in versions.json (0.9 latest, 0.2, 0.1); since 0.2 loses the latest alias, its MkDocs outdated banner now shows, pointing to the root → latest.

URLs kept

/docs/latest/, /latest/performance/, /latest/security/, /latest/roadmap/ keep their paths (the landing and the ndarray README link to /docs/ and /docs/latest/performance/). Every h2–h6 anchor of the live MkDocs pages exists in the new build (checked against the live site): where Hugo's slug differs from MkDocs' (—, / in headings), layouts/_markup/render-heading.html adds the MkDocs anchor as a second id. Only the H1 ids (#performance-go-ndarray-vs-numpy …) go, since the title is now front matter.

Mirrored pages

content/en/performance.md (from ## How a pure-Go library can beat NumPy down = ndarray docs/perf.md, verified byte-identical) and content/en/security.md (ndarray SECURITY.md with links rewritten) keep their mirrored text verbatim; only the H1 became front matter. The README's Mirrored pages section says where they live and how to re-sync them.

Differences from go-fileshare, on purpose

  • No translations, flags, or language switch: the content is English only.
  • go-ndarray/brand has no release tag and no LICENSE file, so the submodule is pinned at commit dd14ca0 and no licence file is mounted beside the marks (fileshare mounts its brand's LICENSE).
  • The outdated-version banner the MkDocs site had (overrides/main.html) is kept as layouts/_partials/custom/content-begin.html (fileshare has none): shown when versions.json gives latest to another version.
  • The heading hook above (fileshare used explicit {#id}s instead; that would have edited the mirrored text).
  • redeploy-version.yml is removed: it rebuilt an old version with MkDocs from main's mkdocs.yml, which no longer exists. The MkDocs-built 0.1 and 0.2 stay as published.

🤖 Generated with Claude Code

tannevaled and others added 2 commits October 9, 2026 14:38
The site was MkDocs Material + mike. It is now a Hugo site on the
tannevaled/hextra fork (submodule, pinned at v0.16.0) with go-ndarray's
brand (submodule go-ndarray/brand), laid out like go-fileshare/docs:
content/en/, the version selector reading versions.json, the page history
script from the theme, and a docs.yml workflow with a pinned, checksummed
Hugo that builds, checks links offline and online, and publishes one
version into gh-pages with scripts/publish-version.sh.

The version label is now ndarray's minor version, read from
params.ndarray.version (v0.9.1 -> 0.9); MkDocs kept publishing it as 0.2.
0.1/ and 0.2/ stay on gh-pages as they were published.

performance.md and security.md keep their mirrored text verbatim; the
heading hook adds MkDocs' anchor where Hugo's differs, so their in-page
links and links published under MkDocs keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er the first deploy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit f0db0dc into main Oct 9, 2026
3 checks passed
@tannevaled
tannevaled deleted the hugo-hextra branch October 9, 2026 12:41
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