{{- /*

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 -}}