journal: render markdown content + title metadata

this has a really basic template and whatnot at the moment, so
styling/etc isn't done, but this is maybe the last major piece before I
could actually see pushing this onto the site
This commit is contained in:
2020-03-07 11:54:26 -06:00
parent 0118eb2994
commit 1f420eab30
8 changed files with 39 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
Title: Index
# test index
this is some test content

View File

@@ -0,0 +1 @@
# this page doesn't have a title!

View File

@@ -17,8 +17,22 @@ def test_journal_file_resolver_other_requests_fine():
def test_journal_file_that_exists(client):
response = client.get('/')
assert response.status_code == 200
assert b'<h1>test index</h1>' in response.data
def test_journal_file_that_doesnt_exist(client):
response = client.get('/ohuesthaoeusth')
assert response.status_code == 404
def test_journal_file_with_title_metadata(client):
response = client.get('/')
assert response.status_code == 200
assert b'<title>Index - incorporeal.org</title>' in response.data
def test_journal_file_without_title_metadata(client):
response = client.get('/no-title')
assert response.status_code == 200
assert b'<title>incorporeal.org</title>' in response.data
assert b'<h1>this page doesn\'t have a title!</h1>' in response.data