From 38c78c0b787bc5fe29f6b024d2d88bdabe3c3476 Mon Sep 17 00:00:00 2001 From: David Kerkeslager Date: Fri, 13 May 2022 23:42:12 -0400 Subject: [PATCH] Use the configured pages from config.json --- app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.py b/app.py index 3c899a8..8e1464a 100644 --- a/app.py +++ b/app.py @@ -6,7 +6,6 @@ import flask with open(pathlib.Path(__file__).parent / 'config.json') as f: CONFIGURATION = json.loads(f.read()) - print(CONFIGURATION) app = flask.Flask(__name__) @@ -21,7 +20,7 @@ def page(name): flask.abort(404) try: - with open('pages/{}.md'.format(name), 'r') as f: + with open(pathlib.Path(CONFIGURATION['directory']) / '{}.md'.format(name), 'r') as f: content = commonmark.commonmark(f.read()) except FileNotFoundError as e: flask.abort(404) -- 2.20.1