diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 22:14:56 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-05-26 22:14:56 +0200 |
commit | 3d8637838e9ccfcb56899842945e760f337428b0 (patch) | |
tree | 2a2780e84b7ed00a0f56234f663fba92d44dfb53 /pkg/config/config.go | |
parent | adc207d2e6c39fa31283d83021e76300c0099c37 (diff) | |
download | cerrado-3d8637838e9ccfcb56899842945e760f337428b0.tar.gz cerrado-3d8637838e9ccfcb56899842945e760f337428b0.tar.bz2 cerrado-3d8637838e9ccfcb56899842945e760f337428b0.zip |
feat: Add about page
Diffstat (limited to 'pkg/config/config.go')
-rw-r--r-- | pkg/config/config.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pkg/config/config.go b/pkg/config/config.go index 776c698..9b6acce 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -16,7 +16,8 @@ type ( } Configuration struct { - Scan *Scan + Scan *Scan + RootReadme string } ) @@ -33,6 +34,11 @@ func Parse(r io.Reader) (*Configuration, error) { return nil, err } + err = setRootReadme(block, &config.RootReadme) + if err != nil { + return nil, err + } + return config, nil } @@ -42,9 +48,15 @@ func defaultConfiguration() *Configuration { Public: true, Path: "", }, + RootReadme: "", } } +func setRootReadme(block scfg.Block, readme *string) error { + scanDir := block.Get("root-readme") + return setString(scanDir, readme) +} + func setScan(block scfg.Block, scan *Scan) error { scanDir := block.Get("scan") err := setString(scanDir, &scan.Path) |