|
| 1 | +{% assign videos = include.videos | default: site.data.videos %} |
| 2 | +{% if videos and videos.size > 0 %} |
| 3 | +<div class="video-grid"> |
| 4 | + {% for video in videos %} |
| 5 | + <article class="video-card" id="{{ video.id }}"> |
| 6 | + <div class="video-embed"> |
| 7 | + <iframe |
| 8 | + src="https://www.youtube-nocookie.com/embed/{{ video.youtube_id }}" |
| 9 | + title="{{ video.title | escape }}" |
| 10 | + loading="lazy" |
| 11 | + allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" |
| 12 | + allowfullscreen |
| 13 | + ></iframe> |
| 14 | + </div> |
| 15 | + <div class="video-card-body"> |
| 16 | + <h3 class="video-card-title"> |
| 17 | + <a href="https://www.youtube.com/watch?v={{ video.youtube_id }}" rel="noopener noreferrer"> |
| 18 | + {{ video.title }} |
| 19 | + </a> |
| 20 | + </h3> |
| 21 | + {% if video.date %} |
| 22 | + <p class="video-card-meta"><time datetime="{{ video.date }}">{{ video.date }}</time></p> |
| 23 | + {% endif %} |
| 24 | + {% if video.description %} |
| 25 | + <p class="video-card-desc">{{ video.description }}</p> |
| 26 | + {% endif %} |
| 27 | + {% if video.boards %} |
| 28 | + <p class="video-card-tags"> |
| 29 | + {% for board in video.boards %} |
| 30 | + <span class="video-tag">{{ board }}</span> |
| 31 | + {% endfor %} |
| 32 | + </p> |
| 33 | + {% endif %} |
| 34 | + {% if video.related_pages %} |
| 35 | + <ul class="video-card-links"> |
| 36 | + {% for link in video.related_pages %} |
| 37 | + <li><a href="{{ link.url | relative_url }}">{{ link.title }}</a></li> |
| 38 | + {% endfor %} |
| 39 | + </ul> |
| 40 | + {% endif %} |
| 41 | + </div> |
| 42 | + <script type="application/ld+json"> |
| 43 | + { |
| 44 | + "@context": "https://schema.org", |
| 45 | + "@type": "VideoObject", |
| 46 | + "name": {{ video.title | jsonify }}, |
| 47 | + "description": {{ video.description | strip | jsonify }}, |
| 48 | + "thumbnailUrl": "https://img.youtube.com/vi/{{ video.youtube_id }}/maxresdefault.jpg", |
| 49 | + "uploadDate": "{{ video.date }}", |
| 50 | + "duration": "{{ video.duration | default: '' }}", |
| 51 | + "embedUrl": "https://www.youtube.com/embed/{{ video.youtube_id }}", |
| 52 | + "contentUrl": "https://www.youtube.com/watch?v={{ video.youtube_id }}", |
| 53 | + "publisher": { |
| 54 | + "@type": "Organization", |
| 55 | + "name": "OpenSolvers", |
| 56 | + "url": "{{ site.url | default: 'https://www.opensolvers.com' }}" |
| 57 | + } |
| 58 | + } |
| 59 | + </script> |
| 60 | + </article> |
| 61 | + {% endfor %} |
| 62 | +</div> |
| 63 | +{% else %} |
| 64 | +<p>No videos yet.</p> |
| 65 | +{% endif %} |
0 commit comments