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.go and cmd/serve.go via cmd.Flags().StringP(...)
- After
config.Load(cfgFile), check if each flag was explicitly set (cmd.Flags().Changed("output")) and override cfg.Build.OutputDir / cfg.Build.DocsDir accordingly
- The rest of the pipeline (
nav.NewSite, builder.Build, server.Start) already threads through the config struct — no deeper changes needed
Acceptance Criteria
Problem
docs_dirandoutput_dirare currently only configurable viakwelea.toml. This means:public/,dist/,_site/) must either edit the config file or maintain multiple config files.Proposed Solution
Add CLI flags to
kwelea buildandkwelea servethat override the config values at runtime:--output/-obuild.output_dirbuild--docsbuild.docs_dirbuild,serveFlags 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:
cmd/build.goandcmd/serve.goviacmd.Flags().StringP(...)config.Load(cfgFile), check if each flag was explicitly set (cmd.Flags().Changed("output")) and overridecfg.Build.OutputDir/cfg.Build.DocsDiraccordinglynav.NewSite,builder.Build,server.Start) already threads through the config struct — no deeper changes neededAcceptance Criteria
kwelea build --output <dir>uses<dir>as output, ignoringkwelea.toml'soutput_dirkwelea build --docs <dir>uses<dir>as docs source, ignoringkwelea.toml'sdocs_dirkwelea serve --docs <dir>uses<dir>as docs source for the dev server--helpoutput with clear descriptions