def is_list_page(page) -> bool: if not page.parent: return False return page.parent.children[0] == page def on_env(env, config, files): env.filters["is_list_page"] = is_list_page