docs-v2/layouts/shortcodes/flux/list-all-functions.html

33 lines
1.6 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{{ $section := (index (findRE "[^/]+.*?" .Page.RelPermalink) 0) }}
{{ $currentVersion := (index (findRE "[^/]+.*?" .Page.RelPermalink) 1) }}
{{ $filters := .Get "filters" | default "" }}
{{ $filterArr := split $filters ", "}}
{{ $tagTaxonomy := print $section "/" $currentVersion "/tags" }}
<ul class="function-list">
{{ range where $.Site.RegularPages.ByTitle "Section" $section }}
{{ $title := replaceRE `\ function` "" .Title }}
{{ $deprecated := isset .Page.Params "deprecated" }}
{{ $removed := isset .Page.Params "removed" }}
{{ $experimental := in .Page.RelPermalink "experimental" }}
{{ $tagList := index .Page.Params $tagTaxonomy | default (slice "") }}
{{ if ne $filters "" }}
{{ if gt (len (intersect $filterArr (index .Page.Params $tagTaxonomy))) 0}}
{{ if and (in .RelPermalink (print $section "/" $currentVersion "/")) (in .Title "() function") }}
<li>
<a href="{{ .RelPermalink }}"{{ if $experimental }} class="experimental"{{end}}>{{ $title }}</a>{{ if $deprecated }} <em style="opacity:.35"> (deprecated)</em>{{ end }}
</li>
{{ end }}
{{ end }}
{{ else }}
{{ if and (in .RelPermalink (print $section "/" $currentVersion "/")) (in .Title "() function") }}
<li class="filter-item visible" data-tags='{{ replaceRE "/" "-" (delimit (apply $tagList "urlize" ".") " ") }}'>
<a href="{{ .RelPermalink }}"{{ if $experimental }} class="experimental"{{end}}>{{ $title }}</a>
{{ if $removed }} <em style="opacity:.35"> (removed)</em>
{{ else if $deprecated }} <em style="opacity:.35"> (deprecated)</em>{{ end }}
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>