define markdown dir relative to content dir

This commit is contained in:
2020-07-28 00:57:21 +02:00
parent 52b1a3cc23
commit bb3c510e07

View File

@@ -192,7 +192,7 @@ def news():
# load article based on config #
try:
with open(article[MARKDOWN_FILE_KEY]) as f:
with open(os.path.join(app.config["CONTENT_DIR"], article[MARKDOWN_FILE_KEY])) as f:
article.update( { MARKDOWN_CONTENT_KEY : markdown2.markdown(f.read()) } )
except FileNotFoundError as e:
return ("File not found Error ({})".format(e), HTTP_NOT_FOUND)