diff --git a/_includes/partials/get_room_live_href.html b/_includes/partials/get_room_live_href.html new file mode 100644 index 00000000..69b87f14 --- /dev/null +++ b/_includes/partials/get_room_live_href.html @@ -0,0 +1,8 @@ +{% assign room_live_href = '' -%} +{%- 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 -%} + {%- endif -%} +{%- endif -%} diff --git a/_includes/partials/header.html b/_includes/partials/header.html index 7181bdc3..304a511c 100644 --- a/_includes/partials/header.html +++ b/_includes/partials/header.html @@ -22,12 +22,15 @@ {%- endif %} - {%- if site.conference.live.streaming.enable -%} - {%- for room in site.rooms -%} + {%- if site.conference.live.streaming.enable %} + {%- for room in site.rooms %} {%- if room.live %} - - {%- endif -%} - {%- endfor -%} + {%- include partials/get_room_live_href.html %} + {%- if room_live_href %} + + {%- endif %} + {%- endif %} + {%- endfor %} {%- endif %} diff --git a/_layouts/data.html b/_layouts/data.html index 2f259a71..258ba195 100644 --- a/_layouts/data.html +++ b/_layouts/data.html @@ -15,13 +15,10 @@ {%- 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 -%} + {%- include partials/get_room_live_href.html -%} + {%- unless room_live_href -%} {%- continue -%} - {%- endif -%} + {%- endunless -%} {%- unless first_room -%} , diff --git a/_layouts/stream-overview.html b/_layouts/stream-overview.html index cdd2d522..113a7a9e 100644 --- a/_layouts/stream-overview.html +++ b/_layouts/stream-overview.html @@ -21,7 +21,8 @@

{{ room.name }}

- + {%- include partials/get_room_live_href.html %} +