--- layout: base --- {% comment %} Get all videos in this collection. {% endcomment %} {% assign videos = site[page.collection] %} {% comment %} Find this video's series. {% endcomment %} {% include 1-tools/series-for-video.html video=page %} {% assign series = out_series %} {% comment %} Sort videos and get previous/next videos. {% endcomment %} {% include 1-tools/sort-videos.html videos=videos seriesPage=series %} {% include 1-tools/previous-next.html videos=out_sortedVideos currentVideo=page %} {% comment %} Find this video's course (may be null). {% endcomment %} {% include 1-tools/series-for-video.html video=series %} {% assign course = out_series %}
{% comment %} Video subtitle. {% endcomment %}
{{ course.title | default: series.title }} {{ page.video_type }} #{% if series.series_number %}{{ series.series_number }}.{% endif %}{{ page.video_number }}
{% if page.remake %}
This video has been remade or updated. You can find the new version on this webpage.
{% endif %}
{% comment %} Include YouTube video player. {% endcomment %} {% include 3-modules/video-player.html video_id=page.video_id %} {% comment %} Previous/Next buttons and 'Watch all' button. {% endcomment %}
{{ content }} {% comment %} Show video topics (used for streams). {% endcomment %} {% if page.topics %} {% include 3-modules/link-list.html links=page.topics title='Topics' class='topics' %} {% endif %}
{% comment %} Show links for live example and code download. {% endcomment %} {% if page.repository != null or page.web_editor != null %}
{% comment %} Detect code variations. {% endcomment %} {% comment %} If repository is (probably) an external link. {% endcomment %} {% if page.repository contains '://' %} {% assign repositoryURL = page.repository %} {% comment %} If repository is a path to a folder in the repository. {% endcomment %} {% elsif page.repository != null %} {% comment %} Ask for code variations {% endcomment %} {% assign repositoryBasePath = '/' | append: page.collection | append: '/' | append: page.repository %} {% assign repositoryBaseURL = site.github.repository_url | append: '/tree/' | append: site.github.source.branch | append: repositoryBasePath %} {% comment %} If page has defined it's own variations create pageVariations for code variation tool. {% endcomment %} {% if page.variations != null %} {% assign pageVariations = page.variations %} {% else %} {% assign pageVariations = null %} {% endif %} {% include 1-tools/code-variations.html repositoryBasePath=repositoryBasePath pageVariations=pageVariations %} {% assign codeVariations = out_codeVariations %} {% assign numberOfVariations = codeVariations | size %} {% assign downloadBaseURL = site.github_download_prefix | append: repositoryBaseURL %} {% for variation in codeVariations %} {% include 3-modules/code-variation.html baseURL=repositoryBaseURL downloadURL=downloadBaseURL variation=variation %} {% endfor %} {% endif %}
{% endif %}