ananke/layouts/partials/func/social/sortNetworks.html
Patrick Kollitsch ae14ccf407
docs(fix): update theme.toml with min version and authors
Signed-off-by: Patrick Kollitsch <patrick@davids-neighbour.com>
2024-10-24 15:28:55 +07:00

24 lines
796 B
HTML

{{- /*
Sorting a list of social networks defined by the order in `networks`.
Only networks present in both `networks` and `setups` will be included. Items missing from `networks` are ignored.
Use `networks` to setup the order of the networks and which network to enable.
Usage: {{ $setups = partials.IncludeCached "func/sortNetworks.html" (dict "networks" $networks "setups" $setups) }}
See also `config/_default/params.toml` > `ananke.social` for details.
*/ -}}
{{- $networks := .networks -}}
{{- $setups := .setups -}}
{{- $output := collections.Slice -}}
{{- range $networks -}}
{{- $network := . -}}
{{- range $setups -}}
{{- if compare.Eq .slug $network -}}
{{- $output = $output | collections.Append . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- return $output -}}