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.
This commit is contained in:
Fabio Manganiello 2022-06-12 00:01:51 +02:00
parent 56a271d0b6
commit 2d18dd5bd6
1 changed files with 3 additions and 1 deletions

View File

@ -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):