aboutsummaryrefslogtreecommitdiff
path: root/_layouts
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-12-24 10:55:38 -0300
committerEuAndreh <eu@euandre.org>2020-12-24 13:07:16 -0300
commit7be007ffb34d4f1be727c9d91570f32b47203117 (patch)
tree074c665a4c9a3fc51ddca41282d84783bbc432bf /_layouts
parentTODOs.org (diff)
downloadeuandre.org-7be007ffb34d4f1be727c9d91570f32b47203117.tar.gz
euandre.org-7be007ffb34d4f1be727c9d91570f32b47203117.tar.xz
Add support for screencasts, behind a feature flag
Diffstat (limited to '')
-rw-r--r--_layouts/cast.html28
-rw-r--r--_layouts/default.html13
-rw-r--r--_layouts/podcast.html19
3 files changed, 41 insertions, 19 deletions
diff --git a/_layouts/cast.html b/_layouts/cast.html
new file mode 100644
index 0000000..330aed7
--- /dev/null
+++ b/_layouts/cast.html
@@ -0,0 +1,28 @@
+---
+layout: post
+---
+
+{% if page.audio %}
+ <audio controls>
+ <source src="{% link /resources/podcasts/{{ page.date | date: "%Y-%m-%d" }}-{{ page.slug }}.ogg %}" type="audio/ogg">
+ <source src="{% link /resources/podcasts/{{ page.date | date: "%Y-%m-%d" }}-{{ page.slug }}.flac %}" type="audio/flac">
+ </audio>
+
+ <div class="torrent-link">
+ {% capture torrent-file %}{{ site.url }}/resources/podcasts/{{ page.date | date: "%Y-%m-%d" }}-{{ page.slug }}.ogg.torrent{% endcapture %}
+ <a href="{{ torrent-file }}">torrent</a>
+ |
+ <a href="/torrent.html?torrent={{ torrent-file | uri_escape }}">online webtorrent</a>
+ </div>
+{% endif %}
+
+{% if page.video %}
+ <div class="torrent-link">
+ {% capture torrent-file %}{{ site.url }}/resources/screencasts/{{ page.date | date: "%Y-%m-%d" }}-{{ page.slug }}.webm.torrent{% endcapture %}
+ <a href="{{ torrent-file }}">torrent</a>
+ |
+ <a href="/torrent.html?torrent={{ torrent-file | uri_escape }}">online webtorrent</a>
+ </div>
+{% endif %}
+
+{{ content }}
diff --git a/_layouts/default.html b/_layouts/default.html
index 8ab772e..441af23 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -11,6 +11,9 @@
{% if site.podcast %}
<link rel="alternate" type="application/atom+xml" href="{{ site.t.podcasts.feed.url[page.lang] }}" hreflang="{{ page.lang }}" title="{{ site.t.podcasts.feed.title[page.lang] }}" />
{% endif %}
+ {% if site.screencast %}
+ <link rel="alternate" type="application/atom+xml" href="{{ site.t.screencasts.feed.url[page.lang] }}" hreflang="{{ page.lang }}" title="{{ site.t.screencasts.feed.title[page.lang] }}" />
+ {% endif %}
<title>{{ page.title }} - EuAndreh</title>
<meta property="og:site_name" content="{{ site.title }}" />
@@ -47,6 +50,9 @@
{% if site.podcast %}
<a href="{% link {{ site.t.podcasts.url[page.lang] }} %}">{{ site.t.podcasts.name[page.lang] }}</a>
{% endif %}
+ {% if site.screencast %}
+ <a href="{% link {{ site.t.screencasts.url[page.lang] }} %}">{{ site.t.screencasts.name[page.lang] }}</a>
+ {% endif %}
<a href="{% link {{ site.t.about.url[page.lang] }} %}">{{ site.t.about.name[page.lang] }}</a>
</div>
{% if page.ref != nil %}
@@ -89,6 +95,13 @@
<a href="{{ lpodcast.url }}" class="{{ lpodcast.lang }}">{{ lpodcast.lang }}</a>
</li>
{% endfor %}
+
+ {% assign lscreencasts=site.screencasts | where:"ref", page.ref | sort: 'lang' %}
+ {% for lscreencast in lscreencasts %}
+ <li>
+ <a href="{{ lscreencast.url }}" class="{{ lscreencast.lang }}">{{ lscreencast.lang }}</a>
+ </li>
+ {% endfor %}
</ul>
{% else %}
{% link break-build-if-any-page-has-a-missing-ref %}
diff --git a/_layouts/podcast.html b/_layouts/podcast.html
deleted file mode 100644
index 197943f..0000000
--- a/_layouts/podcast.html
+++ /dev/null
@@ -1,19 +0,0 @@
----
-layout: post
----
-
-<audio controls>
- <source src="{% link /resources/podcasts/{{ page.date | date: "%Y-%m-%d" }}-{{ page.slug }}.ogg %}" type="audio/ogg">
- <source src="{% link /resources/podcasts/{{ page.date | date: "%Y-%m-%d" }}-{{ page.slug }}.flac %}" type="audio/flac">
-</audio>
-
-<div class="torrent-link">
- {% capture torrent-file %}{{ site.url }}/resources/podcasts/{{ page.date | date: "%Y-%m-%d" }}-{{ page.slug }}.ogg.torrent{% endcapture %}
- <a href="{{ torrent-file }}">torrent</a>
- {% if site.torrent %}
- |
- <a href="/torrent.html?torrent={{ torrent-file | uri_escape }}">online webtorrent</a>
- {% endif %}
-</div>
-
-{{ content }}