From 1e9893cfc25183bbc6ea1ac3ddc8c600fd82290a Mon Sep 17 00:00:00 2001 From: ngn Date: Wed, 17 Jan 2024 21:39:57 +0300 Subject: [PATCH] Adding subdir support --- lib/content.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/content.go b/lib/content.go index 3c4cd1f..24363a9 100644 --- a/lib/content.go +++ b/lib/content.go @@ -35,6 +35,14 @@ func ListContent(dir string) ([]Content, error) { } for _, e := range entries { + if e.IsDir() { + subres, err := ListContent(path.Join(dir, e.Name())) + if err != nil { + return res, err + } + res = append(res, subres...) + } + if(!strings.HasSuffix(e.Name(), ".json")) { continue }