Skip to content

Migrate to Hugo 0.163.3 + modern hugo-clarity; fix mermaid, search, deprecations#1

Merged
foxis merged 3 commits into
mainfrom
migrate/hugo-modern
Jul 3, 2026
Merged

Migrate to Hugo 0.163.3 + modern hugo-clarity; fix mermaid, search, deprecations#1
foxis merged 3 commits into
mainfrom
migrate/hugo-modern

Conversation

@foxis

@foxis foxis commented Jul 2, 2026

Copy link
Copy Markdown

Summary

Modernizes the site's Hugo toolchain and theme, fixes several latent bugs, and makes local/CI builds match.

  • Toolchain: Hugo Extended 0.163.3 locally and in CI (prebuilt via peaceiris/actions-hugo, so the CI binary matches local), Go 1.26 for module resolution.
  • Theme: hugo-clarity module bumped from the 2022 pin to the 2026-06-10 master (css.Sass pipeline).
  • Config deprecations: paginate -> [pagination].pagerSize, languageName -> label.
  • Sass: getStylesBundle override disables source maps for a deterministic fingerprint so the served CSS matches its SRI hash (root cause of the earlier "unstyled dev server").
  • Math: Goldmark passthrough replaces the fragile KaTeX innerHTML rewrite hack.

Fixes

  • Mermaid rendering — diagram source is back inside the rendered element; the previous empty data-mermaid-content placeholder produced UnknownDiagramError once the KaTeX rewrite was removed.
  • Deprecated theme APIs — local overrides of header.html, i18nlist.html, rss.xml use .Language.Label / .Site.Language.Locale (deprecated in Hugo v0.158.0). Build is now warning-free.
  • Search index 404 — exposed params.defaultContentLanguage so English search fetches /index.json (site root) instead of a non-existent /en/index.json.

Cleanup / CI

  • Stop tracking blog/resources/ (gitignored) so Hugo/CI always rebuilds it — avoids stale committed SRI hashes.
  • Removed the unused themes/hugo-clarity-master/ copy (the site consumes the theme as a module).
  • CI cache key now uses the real config path (blog/config/**).
  • README dev prerequisites updated.

Verification (headless Edge against a local server)

  • Build: exit 0, zero warnings/deprecations; parity EN 1892 / LT 49 pages.
  • CSS compiles; served styles.*.css filename hash matches its integrity attribute.
  • Rich content rendered for real: KaTeX, Mermaid, Chart.js, Graphviz, p5.js (screenshots checked).
  • Search: /index.json (EN) and /lt/index.json (LT) both 200; typing a query returns results.
  • SEO intact: <title>, meta description, Person + WebSite JSON-LD in <head>, favicon links, robots.txt, llms.txt, sitemap.xml.
  • CNAME (itohi.com) preserved.

Notes

  • Kept the theme's default LibSass transpiler: the latest hugo-clarity .sass files are not Dart-Sass-clean (tab/space + deprecated @import/darken()), so forcing dartsass fails. This caps Hugo at < 0.166 (where LibSass is removed) until upstream migrates; the getStylesBundle override flips to dartsass with a one-line change when that happens.

Test plan

  • CI Pages build succeeds on merge to main (Hugo 0.163.3 extended).
  • Live site styled; math/mermaid/chart/graphviz/p5.js render.
  • Site search returns results (EN and LT).
  • Favicons, logo, JSON-LD, robots.txt, llms.txt present in production.

dlartisan and others added 3 commits July 2, 2026 20:11
Bump the theme module to the 2026 master (css.Sass pipeline) and move the
toolchain to Hugo Extended 0.163.3. Fix config deprecations (paginate to
pagination.pagerSize, languageName to label). Force a deterministic CSS
build via a getStylesBundle override with source maps disabled so the
fingerprint matches its SRI hash. Modernize math with Goldmark passthrough
and drop the fragile KaTeX innerHTML-rewrite hack.

Co-authored-by: Cursor <cursoragent@cursor.com>
…dex path

Put mermaid source back inside the rendered element so mermaid.js renders it
(the empty data-attribute placeholder produced UnknownDiagramError once the
KaTeX rewrite was removed). Override header, i18nlist and rss templates to use
.Language.Label and .Site.Language.Locale (LanguageName/LanguageCode were
deprecated in Hugo v0.158.0). Expose params.defaultContentLanguage so the
theme search fetches the English index from the site root (/index.json)
instead of a non-existent /en/index.json.

Co-authored-by: Cursor <cursoragent@cursor.com>
…stale theme copy

Install the prebuilt Hugo Extended 0.163.3 in CI via peaceiris/actions-hugo
(matches the local binary) on Go 1.26, and key the resources cache on the
real config path (blog/config/**). Stop tracking blog/resources so Hugo/CI
always rebuilds it (avoids stale committed SRI hashes). Remove the unused
themes/hugo-clarity-master copy (the site consumes the theme as a module) and
update the README dev prerequisites.

Co-authored-by: Cursor <cursoragent@cursor.com>
@foxis foxis merged commit 528a68b into main Jul 3, 2026
2 checks passed
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.

2 participants