{# Video card macro – reused on search, playlist, channel pages. Usage: {% from "partials/video_card.html" import video_card %} {{ video_card(item) }} {{ video_card(item, playlist_id="PLxxx", index=3) }} #} {% macro video_card(video, playlist_id=None, index=None) %} {% set href = "/watch?v=" ~ video.id %} {% if playlist_id %} {% set href = href ~ "&list=" ~ playlist_id ~ "&index=" ~ (index|default(0)) %} {% endif %}
{{ video.title }} {% if video.duration %} {{ video.duration }} {% endif %}
{{ video.title }}
{% if video.channel %}
{{ video.channel }}
{% endif %}
{% endmacro %}