Allow drafts to be viewed live (but not shown on index)
This commit is contained in:
@ -91,7 +91,10 @@ def render_blog_post(slug):
|
|||||||
# check if that file actually exists
|
# check if that file actually exists
|
||||||
path = safe_join(BLOG_DIR, slug + ".rst")
|
path = safe_join(BLOG_DIR, slug + ".rst")
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
abort(404)
|
# check for drafts
|
||||||
|
path = safe_join(BLOG_DIR, slug + ".rst.draft")
|
||||||
|
if not os.path.exists(path):
|
||||||
|
abort(404)
|
||||||
|
|
||||||
# read file
|
# read file
|
||||||
with codecs.open(path, encoding='utf-8') as fd:
|
with codecs.open(path, encoding='utf-8') as fd:
|
||||||
|
Reference in New Issue
Block a user