{{- $href := (.Get 0) -}} {{- $type := (.Get 1) -}} {{- $data := (.Get 2) -}} {{- $link := false -}} {{- if not $type -}} {{- $type = "embed" -}} {{- end -}}
{{- if (eq $type "embed") -}} {{- $link = $href -}} {{- else if in (slice "youtube" "yt") $type -}} {{- $link = (printf "https://youtu.be/%s" $href) -}} {{- $ratio := (split $data ":") -}} {{- end -}}
{{ partial "anchor.html" (dict "Params" (dict "target" "_blank" "rel" "noopener" "href" $link)) }}