{{/* API Section Children Renders tag pages from article data as a children list. Sort order: conceptual tags (traitTags) first, then other tags alphabetically. Uses frontmatter params from generated pages: - articleDataKey: product data key (e.g., 'influxdb3-core') - articleSection: section slug (e.g., 'api' or 'management-api') Data path: data/article_data/influxdb/{articleDataKey}/{articleSection}/articles.yml */}} {{ $currentPage := . }} {{/* Read data key and section from frontmatter */}} {{ $dataKey := .Params.articleDataKey | default "" }} {{ $section := .Params.articleSection | default "" }} {{/* Get article data using frontmatter-driven lookup */}} {{ $articles := slice }} {{ if and $dataKey $section }} {{ with site.Data.article_data }} {{ with index . "influxdb" }} {{ with index . $dataKey }} {{ with index . $section }} {{ with index . "articles" }} {{ with .articles }} {{ $articles = . }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{ end }} {{/* Separate conceptual (traitTag) and non-conceptual articles */}} {{ $conceptualArticles := slice }} {{ $operationArticles := slice }} {{ range $articles }} {{ if and (reflect.IsMap .) (isset . "fields") }} {{ $fields := index . "fields" }} {{ if reflect.IsMap $fields }} {{ $isConceptual := false }} {{ if isset $fields "isConceptual" }} {{ $isConceptual = index $fields "isConceptual" }} {{ end }} {{ if $isConceptual }} {{ $conceptualArticles = $conceptualArticles | append . }} {{ else }} {{ $operationArticles = $operationArticles | append . }} {{ end }} {{ end }} {{ end }} {{ end }} {{/* Sort each group by weight (default 100), then alphabetically by tag name */}} {{ $conceptualArticles = sort $conceptualArticles "fields.weight" }} {{ $operationArticles = sort $operationArticles "fields.weight" }} {{/* Combine: conceptual first, then operations */}} {{ $sortedArticles := $conceptualArticles | append $operationArticles }} {{/* Also include static API pages (HTML files) not in article data */}} {{/* These are compatibility API pages like v1-compatibility, v2, management */}} {{ $staticApiPages := slice }} {{ range $currentPage.Pages }} {{/* Skip pages that are in article data (have tag param) or are all-endpoints */}} {{ if and (not (isset .Params "tag")) (not .Params.isAllEndpoints) }} {{ $staticApiPages = $staticApiPages | append . }} {{ end }} {{ end }} {{ $staticApiPages = sort $staticApiPages "Weight" }}