mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
24.28.2024 ae14ccf4072c13069e1f28e3c5f39bce4b917885
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{{- /*
 
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 -}}