prepend 'journal/' to resolved files

this is where the markdown files will go inside the instance dir
This commit is contained in:
Brian S. Stephan 2020-03-07 09:50:03 -06:00
parent d98a0a7935
commit 3f22b56c09
2 changed files with 4 additions and 4 deletions

View File

@ -20,5 +20,5 @@ def journal_file_resolver(path):
"""
if path.endswith('/'):
path = f'{path}index'
path = f'{path}.md'
path = f'journal/{path}.md'
return path

View File

@ -3,12 +3,12 @@ from incorporealcms.journal import journal_file_resolver
def test_journal_file_resolver_dir_to_index():
assert journal_file_resolver('foo/') == 'foo/index.md'
assert journal_file_resolver('foo/') == 'journal/foo/index.md'
def test_journal_file_resolver_subdir_to_index():
assert journal_file_resolver('foo/bar/') == 'foo/bar/index.md'
assert journal_file_resolver('foo/bar/') == 'journal/foo/bar/index.md'
def test_journal_file_resolver_other_requests_fine():
assert journal_file_resolver('foo/baz') == 'foo/baz.md'
assert journal_file_resolver('foo/baz') == 'journal/foo/baz.md'