website/layouts/shortcodes/youtube-card.html

17 lines
771 B
HTML
Raw Permalink Normal View History

<!-- Youtube card -->
{{ $videoUrl := printf "https://youtube.com/watch?v=%s" (.Get "id") }}
{{ $thumbnailUrl := printf "https://img.youtube.com/vi/%s/0.jpg" (.Get "id") }}
<a href="{{ $videoUrl }}" class="card card-link card-youtube" title="Voir la vidéo &quot;{{ .Get "title" }}&quot; sur YouTube">
<img class="card-image" src="{{ $thumbnailUrl }}" alt="Miniature youtube" />
<div class="card-content">
<h3>{{ .Get "title" }}</h3>
<p>{{ .Get "description" }}</p>
<p class="card-action">
{{ partial "helpers/svg" (dict "path" "icons/youtube" "class" "small-icon youtube-icon") }}
Voir la vidéo sur YouTube {{ partial "helpers/svg" (dict "path" "icons/external" "class" "icon_inline") }}
</p>
</div>
</a>