-
Notifications
You must be signed in to change notification settings - Fork 0
feat: CLI flags to override docs_dir and output_dir #15
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Problem
docs_dir and output_dir are currently only configurable via kwelea.toml. This means:
- CI/CD pipelines that want to output to a platform-specific directory (
public/,dist/,_site/) must either edit the config file or maintain multiple config files. - Monorepo setups that keep docs in a non-default location need a custom config committed for every variant.
Proposed Solution
Add CLI flags to kwelea build and kwelea serve that override the config values at runtime:
kwelea build --output public
kwelea build --docs content/docs --output dist
kwelea serve --docs content/docs
| Flag | Overrides | Commands |
|---|---|---|
--output / -o |
build.output_dir |
build |
--docs |
build.docs_dir |
build, serve |
Flags are purely additive — they override the config value when set but do not require the key to be absent from kwelea.toml. An unset flag leaves the config value unchanged.
Implementation Notes
The change is contained to the command layer:
- Register flags in
cmd/build.goandcmd/serve.goviacmd.Flags().StringP(...) - After
config.Load(cfgFile), check if each flag was explicitly set (cmd.Flags().Changed("output")) and overridecfg.Build.OutputDir/cfg.Build.DocsDiraccordingly - The rest of the pipeline (
nav.NewSite,builder.Build,server.Start) already threads through the config struct — no deeper changes needed
Acceptance Criteria
-
kwelea build --output <dir>uses<dir>as output, ignoringkwelea.toml'soutput_dir -
kwelea build --docs <dir>uses<dir>as docs source, ignoringkwelea.toml'sdocs_dir -
kwelea serve --docs <dir>uses<dir>as docs source for the dev server - Flags are documented in
--helpoutput with clear descriptions - Config file value is used unchanged when the flag is not passed
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers