Skip to content

Auto-generate the hugoautogen workspace via a postinstall hook#474

Merged
chalin merged 4 commits into
google:mainfrom
chalin:chalin-m24-seamless-install-2026-0701
Jul 2, 2026
Merged

Auto-generate the hugoautogen workspace via a postinstall hook#474
chalin merged 4 commits into
google:mainfrom
chalin:chalin-m24-seamless-install-2026-0701

Conversation

@chalin

@chalin chalin commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator
  • Contributes to npm-dep modernization: adopt Hugo's first-class npm-module support for Bootstrap/Font-Awesome docsy#2668
  • Replaces the explicit install:all double-install with an automatic postinstall hook, so a single npm install regenerates and installs the git-ignored hugoautogen workspace — restoring a plain npm install for contributors, Netlify, and CI.
    • Adds a postinstall that runs update:docsy:pack (hugo mod npm pack && npm install --ignore-scripts); the --ignore-scripts on the nested install keeps the hook from recursing.
    • Runs on Linux, macOS, and Windows: the hook chains only portable npm-script steps (hugo, npm, &&), with no shell-specific syntax.
    • Reverts netlify.toml, the links workflow, and the README to a plain npm install, and drops the now-redundant install:all script.
    • Documents in the README why this single install also builds the theme's npm asset workspace (Hugo is sourced via npm; the theme's assets are discovered through Hugo modules).
  • Follow-up to Stop committing the generated hugoautogen workspace #473 (which stopped committing the workspace): keeps it git-ignored and regenerates it on install.

chalin added 4 commits July 1, 2026 14:11
- Replaces the explicit `install:all` double-install with an automatic `postinstall` hook, so a single `npm install` regenerates and installs the git-ignored `hugoautogen` workspace — restoring a plain `npm install` for contributors, Netlify, and CI.
  - Adds `postinstall`: `npm run update:docsy:pack -- --ignore-scripts`; the `--ignore-scripts` on the nested install keeps the hook from recursing.
  - Reverts `netlify.toml`, the links workflow, and the README to a plain `npm install`, and drops the now-redundant `install:all` script.
  - Documents in the README why this single install also builds the theme's npm asset workspace (Hugo is sourced via npm; the theme's assets are discovered through Hugo modules).
- Notes that `npm install` now requires Go, since the `postinstall` hook runs `hugo mod npm pack`, and broadens the existing `go`-not-found troubleshooting entry to say it can surface at install time, not only when serving.
- Aligns the local-clone command to `hugo serve`, matching the rest of the README and the `serve` npm script.
- Formats the `VERSION` placeholder as italic code, per the Google placeholder style.
@chalin chalin merged commit b822fed into google:main Jul 2, 2026
12 checks passed
@chalin chalin deleted the chalin-m24-seamless-install-2026-0701 branch July 2, 2026 01:00
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