Skip to content

Commit

Permalink
Extend menu and live capabilities for links to home layout
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzschmid committed Nov 14, 2020
1 parent 4887ba1 commit 655d46c
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
jekyll-theme-conference (2.5.1)
jekyll-theme-conference (2.5.2)
jekyll (~> 4.0)

GEM
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,6 @@ conference:

The navigation bar is located at the top and visible on every site. On the right it show the title of the website (`site.title`) followed by the links listed under the `links` property of the `navigation` property. See the _Content_ > _Links_ section below for the available properties per link.

Additionally, a navigation bar link can also have the following properties:

- `menu` containing another list of links. This creates a dropdown menu of multiple sublinks. The sublinks have the same properties as regular links (see the _Content_ > _Links_ section), or
- `live` making the link only visible during the conference and adds a live indication. The `name` property can be omitted. If streaming is enabled and any URL property is omitted, a click on the link will open the streaming modal (see section _Live Indications_ below).

Example:

```yaml
Expand Down Expand Up @@ -519,6 +514,11 @@ Links are used at different location throughout the theme: They can either be us
+ pointing to a file uploaded to the `/documents` folder (for talks `/documents/slides`, for speakers `/documents/bio`): `file:`
+ pointing to an external video: `video:`

Additionally, a navigation bar or main landing page link can also have the following properties:

- `menu` containing another list of links. This creates a dropdown menu of multiple sublinks. The sublinks have the same properties as regular links, or
- `live` making the link only visible during the conference and adds a live indication. The `name` property can be omitted. If streaming is enabled and any URL property is omitted, a click on the link will open the streaming modal (see section _Live Indications_ above).

Using the `file:` indicator, the relative address is automatically set as well as the icon. Using the `video:` indicator, the link is automatically configured to open in an iframe with a corresponding title and the icon is set.

Example:
Expand Down
1 change: 1 addition & 0 deletions _includes/partials/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
{% for link in site.conference.navigation.links %}

{% if link.menu %}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbar-dropdown{{ forloop.index0 }}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down
62 changes: 56 additions & 6 deletions _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,63 @@ <h1 class="display-3">
{{ content }}

{% if site.conference.main.links %}
<p class="lead d-print-none">
<div class="lead d-print-none">
{% for link in site.conference.main.links %}
{% assign link_styleclass = "btn btn-outline-primary btn-lg mt-2" %}
{% include partials/get_link.html %}
{{ link_tag }}
{{ link.name }}
</a>

{% if link.menu %}
<div class="dropdown d-inline">
<a class="btn btn-outline-primary btn-lg mt-2 dropdown-toggle" href="#" role="button" id="main-dropdown{{ forloop.index0 }}" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ link.name }}
</a>
<div class="dropdown-menu" aria-labelledby="main-dropdown{{ forloop.index0 }}">
{% assign parent_link = link %}
{% for link in parent_link.menu %}
{% assign link_styleclass = "dropdown-item" %}
{% include partials/get_link.html %}
{{ link_tag }}
{{ link.name }}
</a>
{% endfor %}
</div>
</div>

{% elsif link.live %}
{% include partials/get_conf_time.html %}
{% assign time_start = conf_start %}
{% assign time_end = conf_end %}
{% include partials/get_timestamp.html %}

{% assign offset_start = site.conference.live.streaming.start_early | default: 0 %}
{% assign offset_end = site.conference.live.streaming.end_late | default: 0 %}
{% assign timestamp_start = offset_start | times: -60 | plus: timestamp_start %}
{% assign timestamp_end = offset_end | times: 60 | plus: timestamp_end %}

{% if link.name %}
{% assign link_name = link.name %}
{% else %}
{% assign link_name = site.data.lang[site.conference.lang].live.streaming | default: "Live Stream" %}
{% endif %}

<span class="live-show d-none" data-start="{{ timestamp_start }}" data-end="{{ timestamp_end }}">
{% if site.conference.live.streaming %}
<a class="btn btn-outline-primary btn-lg mt-2" title="{{ link_name }}" data-toggle="modal" data-target="#stream-modal" data-room="" href="#">
{% else %}
{% assign link_styleclass = "btn btn-outline-primary btn-lg mt-2" %}
{% include partials/get_link.html %}
{{ link_tag }}
{% endif %}

{{ link_name }}
</a>
</span>

{% else %}
{% assign link_styleclass = "btn btn-outline-primary btn-lg mt-2" %}
{% include partials/get_link.html %}
{{ link_tag }}
{{ link.name }}
</a>
{% endif %}
{% endfor %}
</p>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion jekyll-theme-conference.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |spec|
spec.name = "jekyll-theme-conference"
spec.version = "2.5.1"
spec.version = "2.5.2"
spec.authors = ["Lorenz Schmid"]
spec.email = ["lorenzschmid@users.noreply.github.com"]

Expand Down

0 comments on commit 655d46c

Please sign in to comment.