2023-09-08 22:10:52 +01:00
|
|
|
def is_list_page(page) -> bool:
|
|
|
|
if not page.parent:
|
|
|
|
return False
|
|
|
|
|
|
|
|
return page.parent.children[0] == page
|
|
|
|
|
2023-09-08 22:32:51 +01:00
|
|
|
def children(page):
|
|
|
|
if not is_list_page(page):
|
|
|
|
return []
|
|
|
|
return page.parent.children[1:]
|
|
|
|
|
2023-09-08 22:10:52 +01:00
|
|
|
def on_env(env, config, files):
|
|
|
|
env.filters["is_list_page"] = is_list_page
|
2023-09-08 22:32:51 +01:00
|
|
|
env.filters["children"] = children
|