`hbx dev` and `hbx build` reject additional Hugo arguments despite documenting `[hugoArgs...]`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Ambito
- cli
Direzione di ricerca
Start with the hbx dev and hbx build command entry points and reproduce the failure using --buildDrafts, then inspect how command-line arguments are parsed before Hugo is invoked. Done means the documented [hugoArgs...] behavior is consistent: Hugo arguments are accepted and forwarded, or the required -- separator and limitation are documented clearly.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/HugoBlox/kit/issues?q=is%3Aissue
- This issue is not a question, feature request, or anything other than a bug report directly related to HugoBlox Kit. Please post those things on Discord: https://discord.gg/z8wNYzb
Description
Summary
The HugoBlox CLI documentation for hbx dev and hbx build indicates that both commands accept additional positional arguments through [hugoArgs...]. These arguments appear intended to be forwarded to the underlying hugo server or hugo command.
However, Hugo flags passed through hbx are currently rejected as unknown HugoBlox CLI options.
For example, attempting to include drafts in the development server fails:
$ hbx dev --buildDrafts
👋 Welcome to the Early Access / Preview Edition of HugoBlox CLI!
We'd love your feedback on our Discord: https://hugoblox.com/discord
Report issues: https://github.com/HugoBlox/kit/issues
error: unknown option '--buildDrafts'
Expected behavior
Arguments not handled directly by HugoBlox CLI should be forwarded to the underlying Hugo command.
For example:
hbx dev --buildDrafts
should behave equivalently to:
hugo server --disableFastRender --buildDrafts
Similarly:
hbx build --buildDrafts
should behave equivalently to:
hugo --gc --minify --buildDrafts
Alternatively, if Hugo arguments must be separated using --, the following should work and the requirement should be documented clearly:
hbx dev -- --buildDrafts
hbx build -- --buildDrafts
Actual behavior
Hugo options beginning with - or -- are parsed as HugoBlox CLI options and rejected before they can be forwarded to Hugo.
error: unknown option '--buildDrafts'
Relevant help output
The help text for hbx dev documents a variadic hugoArgs argument:
Usage: hbx dev [options] [hugoArgs...]
Start the Hugo development server (hugo server)
Options:
--path <dir> Project directory (defaults to cwd)
--no-default-flags Disable automatic --disableFastRender flag
--quiet Suppress all output except errors
--filter Show only warnings and errors (hide info messages)
--verbose Show all Hugo output (default)
-h, --help display help for command
The same is true for hbx build:
Usage: hbx build [options] [hugoArgs...]
Run a production Hugo build (hugo --gc --minify)
Options:
--path <dir> Project directory (defaults to cwd)
--no-default-flags Disable automatic --gc/--minify flags
--quiet Suppress all output except errors
--filter Show only warnings and errors (hide info messages)
-h, --help display help for command
This makes it appear that arbitrary Hugo arguments are supported, but the current option parsing prevents commonly used Hugo flags from being passed.
Suggested resolution
One of the following would resolve the ambiguity:
- Allow unknown options after the command name to be captured in
[hugoArgs...]and forwarded to Hugo. - Support forwarding arguments after the conventional
--separator. - If forwarding Hugo flags is not supported, remove
[hugoArgs...]from the usage text and document the limitation.
Supporting -- would likely provide the clearest distinction between HugoBlox CLI options and options intended for Hugo:
hbx dev --path ./site -- --buildDrafts --buildFuture
Reproduction Link
https://github.com/AliSajid/hugoblox-cli-args-reprex
Steps to Reproduce
Steps to reproduce
-
Open a HugoBlox project.
-
Run:
hbx dev --buildDrafts -
Observe that the CLI exits with:
error: unknown option '--buildDrafts'
The same issue appears to affect hbx build when passing options intended for the underlying Hugo command.
Expected Result
Expected behavior
Arguments not handled directly by HugoBlox CLI should be forwarded to the underlying Hugo command.
For example:
hbx dev --buildDrafts
should behave equivalently to:
hugo server --disableFastRender --buildDrafts
Similarly:
hbx build --buildDrafts
should behave equivalently to:
hugo --gc --minify --buildDrafts
Actual Result
$ hbx dev --buildDrafts
👋 Welcome to the Early Access / Preview Edition of HugoBlox CLI!
We'd love your feedback on our Discord: https://hugoblox.com/discord
Report issues: https://github.com/HugoBlox/kit/issues
error: unknown option '--buildDrafts'
What Hugo Module versions does your site use?
module github.com/HugoBlox/kit/templates/starter
go 1.19
require github.com/HugoBlox/kit/modules/blox v0.12.0
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
No response
Which Hugo Blox template are you using?
Starter for the reprex repo. Independent of template.
What version of Hugo are you using?
hugo v0.159.2-5f4646acaad89e1166aac118e118b0d28013f460+extended darwin/arm64 BuildDate=2026-04-01T12:59:20Z VendorInfo=gohugoio
- Lingua principale
- HTML
- Stelle
- 9.8k
- Fork
- 2.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di HugoBlox/kit
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
proposal stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Feature request (docs): add an "Accessibility" page documenting HugoBlox's built-in a11y featuresApertaproposal stale
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
-
needs triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
Tutte le issue di HugoBlox/kit
Issue simili
-
cli good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Agent-Threat-Rule/agent-threat-rules#766 ·
I maintainer di solito rispondono entro 1 giorno
-
[v5-preview5] `func new` displays incorrect command in error message when project is not initializedApertaNeeds: Triage (Functions) v5 v5-preview5
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
Azure/azure-functions-core-tools#5838 ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
good first issue help wanted new check
Difficoltà 2/5 3-5 giorni Idoneità per principianti 78/100