{{ range $i, $link := .Params.links }}

{{- $link.title -}}

{{ with $link.description }} {{ . }} {{ else }} {{ $link.website }} {{ end }}
{{ with $link.image }} {{ $permalink := . }} {{ with ($.Resources.GetMatch (printf "%s" (. | safeURL))) }} {{ $permalink = .RelPermalink }} {{ end }}
{{ end }}
{{ end }}