publiccode.si/site/layouts/partials/organisations.html

33 lines
1.3 KiB
HTML

{{ "<!-- ORGANISATIONS -->" | safeHTML }}
<section id="organisations">
<div class="container">
<div class="text-center">
<h2 class="section-heading">{{ .Site.Params.organisations.headline }}</h2>
<hr />
<!-- replace the URL defined in config.toml because this snipped is used in sub-pages too -->
<p>{{ replace .Site.Params.organisations.text "openletter/" ("/openletter" | relLangURL) | markdownify }}</p>
<div class="orgs">
<ul>
{{ $orgs := getJSON "data/organisations/organisations.json" }}
{{ $lower := sort $orgs "name" }}
{{ $.Scratch.Set "lower_names" (slice) }}
{{ range $lower }}
{{ $.Scratch.Add "lower_names" (lower .name) }}
{{ end }}
{{ range sort ($.Scratch.Get "lower_names") }}
{{ $lower_int := . }}
{{ range $int := $orgs }}
{{ if eq $lower_int (lower $int.name) }}
<li><a href="{{ .url }}" class="hiddenlink" title="{{ .name }}" style="background-image: url(/img/organisations/{{ .img }})" target="_blank"></a></li>
{{ end }}
{{ end }}
{{ end }}
</ul>
</div>
</div>
</div>
</section>