prepend 'journal/' to resolved files
this is where the markdown files will go inside the instance dir
This commit is contained in:
parent
d98a0a7935
commit
3f22b56c09
@ -20,5 +20,5 @@ def journal_file_resolver(path):
|
|||||||
"""
|
"""
|
||||||
if path.endswith('/'):
|
if path.endswith('/'):
|
||||||
path = f'{path}index'
|
path = f'{path}index'
|
||||||
path = f'{path}.md'
|
path = f'journal/{path}.md'
|
||||||
return path
|
return path
|
||||||
|
@ -3,12 +3,12 @@ from incorporealcms.journal import journal_file_resolver
|
|||||||
|
|
||||||
|
|
||||||
def test_journal_file_resolver_dir_to_index():
|
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():
|
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():
|
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'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user