{% extends "base.html" %} {% from 'partials/navigation-components.html' import page_navigation %} {% from 'partials/components/tags.html' import tag_list %} {% from 'partials/components/tiles.html' import content_tiles %} {% from 'partials/theme-primitives.html' import theme_docs_frame %} {% def parse_discover_config(discover_config, default_title, default_variant='compact', default_limit=5) %} {% match discover_config %} {% case false %} {{ {'enabled': false, 'title': none, 'variant': none, 'limit': 0} }} {% case _ if discover_config is mapping %} {{ { 'enabled': true, 'title': discover_config.title ?? default_title if discover_config.title is not sameas false else none, 'variant': discover_config.variant ?? default_variant, 'limit': discover_config.limit ?? default_limit } }} {% case _ if discover_config is number %} {{ {'enabled': true, 'title': default_title, 'variant': default_variant, 'limit': discover_config} }} {% case _ %} {{ {'enabled': true, 'title': default_title, 'variant': default_variant, 'limit': default_limit} }} {% end %} {% end %} {% block content %} {% let discover = params?.discover ?? {} %} {% let children_config = parse_discover_config(discover?.children, 'In This Section', 'compact', 999) %} {% let related_config = parse_discover_config(discover?.related, 'Related Pages', 'compact', 5) %} {% let show_children_feature = 'content.children' in (theme?.features ?? []) %} {% let show_children = children_config.enabled and show_children_feature %} {% let show_related = related_config.enabled %} {% let has_children = (posts | length > 0) or (subsections | length > 0) %} {% let related_posts = page?.related_posts ?? [] %} {% let has_related = show_related and (related_posts | length > 0) %} {% call theme_docs_frame(has_toc=toc_items | length > 0) %} {% slot sidebar %} {% include 'partials/docs-nav.html' %} {% end %} {% let _list_hero_default = 'overview' %} {% include 'partials/page-hero.html' %}
{{ content | safe }}
{% if show_children and (has_children or has_related) %} {% cache "doc-list-tiles-" ~ (page?.href ?? '') ~ "-" ~ (site?.build_id ?? '') %}
{{ content_tiles( title=children_config.title if has_children else none, children=posts if show_children else none, subsections=subsections if show_children else none, related=related_posts[:related_config.limit] if has_related else none, related_title=related_config.title, variant=children_config.variant, group_by='type' if has_children and has_related else none, page=page ) }}
{% endcache %} {% end %} {% if page?.tags | length > 0 %} {% end %}
{{ page_navigation(page) }} {% slot toc %} {% include 'partials/docs-toc-sidebar.html' %} {% end %} {% end %} {% end %}