github.com/fighterlyt/hugo@v0.47.1/tpl/tplimpl/embedded/templates/shortcodes/vimeo_simple.html (about) 1 {{ $id := .Get "id" | default (.Get 0) }} 2 {{- $item := getJSON "https://vimeo.com/api/oembed.json?url=https://vimeo.com/" $id -}} 3 {{ $class := .Get "class" | default (.Get 1) }} 4 {{ $hasClass := $class }} 5 {{ $class := $class | default "__h_video" }} 6 {{ if not $hasClass }} 7 {{/* If class is set, assume the user wants to provide his own styles. */}} 8 {{ template "__h_simple_css" $ }} 9 {{ end }} 10 {{ $secondClass := "s_video_simple" }} 11 <div class="{{ $secondClass }} {{ $class }}"> 12 {{- with $item }} 13 <a href="{{ .provider_url }}{{ .video_id | safeHTMLAttr }}" target="_blank"> 14 {{ $thumb := .thumbnail_url }} 15 {{ $original := $thumb | replaceRE "(_.*\\.)" "." }} 16 <img src="{{ $thumb }}" srcset="{{ $thumb }} 1x, {{ $original }} 2x" alt="{{ .title }}"> 17 <div class="play">{{ template "__h_simple_icon_play" $ }}</div></a></div> 18 {{- end -}}