From 2d18dd5bd6d36b633ddbf8cda086f6642a4f00ff Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 12 Jun 2022 00:01:51 +0200 Subject: [PATCH] More flexible structure for the content directory. If the `markdown` subfolder does not exist, then the whole `config.content_dir` is treated as the root for markdown files. --- madblog/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/madblog/app.py b/madblog/app.py index 7847ac5..256fc5e 100644 --- a/madblog/app.py +++ b/madblog/app.py @@ -22,7 +22,9 @@ class BlogApp(Flask): self.fonts_dir = config.default_fonts_dir if not os.path.isdir(self.pages_dir): - raise FileNotFoundError(self.pages_dir) + # If the `markdown` subfolder does not exist, then the whole + # `config.content_dir` is treated as the root for markdown files. + self.pages_dir = os.path.join(config.content_dir) img_dir = os.path.join(config.content_dir, 'img') if os.path.isdir(img_dir):