summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/main.go b/main.go
index 71f5f94..fecc2d8 100644
--- a/main.go
+++ b/main.go
@@ -144,9 +144,22 @@ func buildProject(projectRoot string) {
}
// Gets the list of all markdown files.
- files, err := filepath.Glob(path.Join(projectRoot, "content/*.md"))
+ var files []string
+ err = filepath.Walk(path.Join(projectRoot, "content/"), func(path string, info os.FileInfo, err error) error {
+ if err != nil {
+ return err
+ }
+
+ if !info.IsDir() && strings.ToLower(filepath.Ext(path)) == ".md" {
+ files = append(files, path)
+ }
+
+ return nil
+ })
+
if err != nil {
- panic(err)
+ fmt.Printf("No markdown files found with error `%s`.\n", err)
+ os.Exit(1)
}
md := goldmark.New(