From 36f0071087bd3356afd8fe36705c3d667c617149 Mon Sep 17 00:00:00 2001 From: Lorenz Schmid Date: Mon, 28 Feb 2022 12:13:02 +0100 Subject: [PATCH] Allow for relative live streaming links --- Gemfile.lock | 2 +- README.md | 17 ++++++++++++++++- _layouts/data.html | 10 +++++++++- jekyll-theme-conference.gemspec | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7f9d4021..03ef9690 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - jekyll-theme-conference (3.4.0) + jekyll-theme-conference (3.6.0) jekyll (~> 4.0) GEM diff --git a/README.md b/README.md index 32066dfc..98fe2e39 100644 --- a/README.md +++ b/README.md @@ -620,7 +620,22 @@ Each room is represented by a file in the `_rooms/` directory. It must begin wit - the room's `name` - optionally `hide: true` if the room's page should not be linked to, and -- optionally a URL pointing to a live stream for the given room during the conference (`live`, see the section _Live Indications & Streaming_ above). +- optionally under the `live` property a URL pointing to a live stream for the given room during the conference (see the section _Live Indications & Streaming_ above), either: + * as an `absolute_url`, or + * a `relative_url`. + +Example: + +```yaml +--- +name: The Room +hide: false +live: + absolute_url: https://github.com +--- + +... +``` ### Links diff --git a/_layouts/data.html b/_layouts/data.html index 858e91ce..2f259a71 100644 --- a/_layouts/data.html +++ b/_layouts/data.html @@ -15,6 +15,14 @@ {%- assign first_room = true -%} {%- for room in site.rooms %} {%- if room.live -%} + {%- if room.live.absolute_url -%} + {%- assign room_live_href = room.live.absolute_url -%} + {%- elsif room.live.relative_url -%} + {%- assign room_live_href = room.live.relative_url | prepend: site.baseurl -%} + {%- else -%} + {%- continue -%} + {%- endif -%} + {%- unless first_room -%} , {%- else -%} @@ -23,7 +31,7 @@ "{{ room.name }}": { "id": {{ forloop.index }}, "name": "{{ room.name }}", - "href": "{{ room.live }}" + "href": "{{ room_live_href }}" } {%- endif -%} {%- endfor %} diff --git a/jekyll-theme-conference.gemspec b/jekyll-theme-conference.gemspec index 0a38d56a..f25be28a 100644 --- a/jekyll-theme-conference.gemspec +++ b/jekyll-theme-conference.gemspec @@ -2,7 +2,7 @@ Gem::Specification.new do |spec| spec.name = "jekyll-theme-conference" - spec.version = "3.5.0" + spec.version = "3.6.0" spec.authors = ["Lorenz Schmid"] spec.email = ["lorenzschmid@users.noreply.github.com"]