{{ define "title" }} {{ site.Title }} | {{ .Title }} {{ end }} {{ define "main" }}
{{ partial "docs/dashboard-panel.html" . }}
{{ partial "docs/navbar.html" . }}
{{ $scratch := newScratch }} {{ range $name, $integration := $.Site.Data.integrations.integrations }} {{ $scratch.Set "tutorials" 0 }} {{ if isset $integration "tutorials" }} {{ $hosts := slice }} {{ range $elem := index $integration "tutorials" }} {{ $url := urls.Parse $elem }} {{ $hosts = $hosts | append $url.Host }} {{ end }} {{ $scratch.Set "tutorials" (len ($hosts | uniq)) }} {{ end }} {{ $scratch.Set "videos" 0 }} {{ if isset $integration "videos" }} {{ $scratch.Set "videos" (len (index $integration "videos")) }} {{ end }} {{ $scratch.Set "blogs" 0 }} {{ if isset $integration "blogs" }} {{ $hosts := slice }} {{ range $elem := index $integration "blogs" }} {{ $url := urls.Parse $elem }} {{ $hosts = $hosts | append $url.Host }} {{ end }} {{ $scratch.Set "blogs" (len ($hosts | uniq)) }} {{ end }} {{ $scratch.Set "code" 0 }} {{ if isset $integration "code" }} {{ $scratch.Set "code" (len (index $integration "code")) }} {{ end }} {{ $rank := (add ($scratch.Get "tutorials") (add ($scratch.Get "videos") (add ($scratch.Get "blogs") ($scratch.Get "code")))) }} {{ $scratch.Add "integration-names" (slice (dict "name" $name "rank" $rank)) }} {{ end }} {{ range $integrations := (sort ($scratch.Get "integration-names") "rank" "desc") }} {{ $name := (index $integrations "name") }} {{ $rank := (index $integrations "rank") }} {{ $integration := (index $.Site.Data.integrations.integrations $name) }}
{{ partial "docs/integration-logo.html" (dict "name" $name) }}

{{- $integration.title -}}

{{ end }}
{{ end }}