aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-27 16:32:58 +0000
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-27 16:32:58 +0000
commitdb0b5c34432b4c0135af8c5c885fd6ad348c3691 (patch)
tree8f38b973a8dd3fc22bbd28498004940451621b41 /main.go
parent7bd309f3ca44930c5207b94acc2d425b24d4b369 (diff)
parent1e2ad3a8f8cd2c12786b92210616325a33d1b209 (diff)
Merge pull request '[Feat] Custom sections' (#1) from feat/custom-sections into main
Reviewed-on: https://git.anhgelus.world/anhgelus/small-web/pulls/1
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/main.go b/main.go
index add522c..480762d 100644
--- a/main.go
+++ b/main.go
@@ -58,9 +58,11 @@ func main() {
os.Exit(1)
}
- if ok = backend.LoadLogs(cfg); !ok {
- slog.Info("exiting")
- os.Exit(2)
+ for _, sec := range cfg.Sections {
+ if ok = sec.Load(cfg); !ok {
+ slog.Info("exiting")
+ os.Exit(2)
+ }
}
assetsFS := backend.UsableEmbedFS("dist", embeds)
@@ -72,7 +74,9 @@ func main() {
backend.HandleHome(r)
backend.HandleRoot(r, cfg)
- backend.HandleLogs(r)
+ for _, sec := range cfg.Sections {
+ sec.Handle(r)
+ }
backend.Handle404(r)
backend.HandleStaticFiles(r, "/assets", assetsFS)