If img_dir is not found under content_dir then treat content_dir itself as img_dir

This commit is contained in:
Fabio Manganiello 2022-06-14 00:44:01 +02:00
parent 696547ac48
commit 5ee10b0d38

View file

@ -24,11 +24,13 @@ class BlogApp(Flask):
if not os.path.isdir(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)
self.pages_dir = config.content_dir
img_dir = os.path.join(config.content_dir, 'img')
if os.path.isdir(img_dir):
self.img_dir = os.path.abspath(img_dir)
else:
self.img_dir = config.content_dir
css_dir = os.path.join(config.content_dir, 'css')
if os.path.isdir(css_dir):