From 2734c671324e980ef7424e367461ebaa4e0034a5 Mon Sep 17 00:00:00 2001 From: Mitchell Riedstra Date: Mon, 12 Jul 2021 23:06:42 -0400 Subject: Add atom feed to site, require config.yml --- cmd/server/main.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'cmd/server/main.go') diff --git a/cmd/server/main.go b/cmd/server/main.go index b2a95c3..b1e53d9 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -37,7 +37,8 @@ func main() { directory := fl.String("d", ".", "Directory to serve.") version := fl.Bool("v", false, "Print the version then exit") fl.StringVar(&page.TimeFormat, "T", page.TimeFormat, "Print the version then exit") - indexPath := fl.String("i", "/reIndex", + defaultIndexPath := "/reIndex" + indexPath := fl.String("i", defaultIndexPath, "Path in which, when called will rebuild the index and clear the cache") _ = fl.Parse(os.Args[1:]) @@ -55,8 +56,15 @@ func main() { app = &App{} } - app.ReIndexPath = *indexPath - app.StaticDirectory = "static" + if app.ReIndexPath == "" || *indexPath != defaultIndexPath { + app.ReIndexPath = *indexPath + } + if app.StaticDirectory == "" { + app.StaticDirectory = "static" + } + if app.FeedPrefix == "" { + app.FeedPrefix = FeedPrefixDefault + } b, _ := yaml.Marshal(app) os.Stderr.Write(b) -- cgit v1.2.3