Skip to content

Commit

Permalink
Add PurgeCSS and Terser to CI example and remove whitespaces from par…
Browse files Browse the repository at this point in the history
…tials

Closes #5
  • Loading branch information
lorenzschmid committed Nov 19, 2020
1 parent 50204f7 commit 9ea7bf0
Show file tree
Hide file tree
Showing 20 changed files with 317 additions and 294 deletions.
62 changes: 31 additions & 31 deletions _includes/partials/checks.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
{% assign errors = '' | split: ',' %}
{%- assign errors = '' | split: ',' -%}

{% unless site.data.lang.version %}
{% unless site.conference.lang == "en" %}
{% assign errors = errors | push : "The internationalization file containing different strings for this template seems to be missing. Have you copied the `_data/lang.yml` file from the [theme's repository](https://github.com/DigitaleGesellschaft/jekyll-theme-conference/blob/master/_data/lang.yml) to you local website folder?" %}
{% endunless %}
{% elsif site.data.lang.version < 4 %}
{% assign errors = errors | push : "The internationalization file in `_data/lang.yml` seems to be outdated and does not correspond to the current version of the theme. Grab the current version from the [theme's repository](https://github.com/DigitaleGesellschaft/jekyll-theme-conference/blob/master/_data/lang.yml)." %}
{% endunless %}
{% unless site.conference.lang == "en" or site.conference.lang == "de" or site.conference.lang == "fr" or site.conference.lang == "pt" %}
{% assign errors = errors | push : "Unknown language selected for `site.conference.lang` parameter. Supported are `en`, `de`, `fr`, and `pt`." %}
{% endunless %}
{%- unless site.data.lang.version -%}
{%- unless site.conference.lang == "en" -%}
{%- assign errors = errors | push : "The internationalization file containing different strings for this template seems to be missing. Have you copied the `_data/lang.yml` file from the [theme's repository](https://github.com/DigitaleGesellschaft/jekyll-theme-conference/blob/master/_data/lang.yml) to you local website folder?" -%}
{%- endunless -%}
{%- elsif site.data.lang.version < 4 -%}
{%- assign errors = errors | push : "The internationalization file in `_data/lang.yml` seems to be outdated and does not correspond to the current version of the theme. Grab the current version from the [theme's repository](https://github.com/DigitaleGesellschaft/jekyll-theme-conference/blob/master/_data/lang.yml)." -%}
{%- endunless -%}
{%- unless site.conference.lang == "en" or site.conference.lang == "de" or site.conference.lang == "fr" or site.conference.lang == "pt" -%}
{%- assign errors = errors | push : "Unknown language selected for `site.conference.lang` parameter. Supported are `en`, `de`, `fr`, and `pt`." -%}
{%- endunless -%}

{% assign program_size = site.data.program | size %}
{% if program_size == 0 %}
{% assign errors = errors | push : "Your schedule in `_data/program.yml` does not seem to contain any entry. Have you already created the file?" %}
{% endif %}
{% assign talk_size = site.talks | size %}
{% if talk_size == 0 %}
{% assign errors = errors | push : "The `talks` collection does not seem to contain any entry. Have you accidentially renamed the collection or is your `_talks/` folder empty?" %}
{% endif %}
{% assign speaker_size = site.speakers | size %}
{% if speaker_size == 0 %}
{% assign errors = errors | push : "The `speakers` collection does not seem to contain any entry. Have you accidentially renamed the collection or is your `_speakers/` folder empty?" %}
{% endif %}
{% assign room_size = site.rooms | size %}
{% if room_size == 0 %}
{% assign errors = errors | push : "The `rooms` collection does not seem to contain any entry. Have you accidentially renamed the collection or is your `_rooms/` folder empty?" %}
{% endif %}
{%- assign program_size = site.data.program | size -%}
{%- if program_size == 0 -%}
{%- assign errors = errors | push : "Your schedule in `_data/program.yml` does not seem to contain any entry. Have you already created the file?" -%}
{%- endif -%}
{%- assign talk_size = site.talks | size -%}
{%- if talk_size == 0 -%}
{%- assign errors = errors | push : "The `talks` collection does not seem to contain any entry. Have you accidentially renamed the collection or is your `_talks/` folder empty?" -%}
{%- endif -%}
{%- assign speaker_size = site.speakers | size -%}
{%- if speaker_size == 0 -%}
{%- assign errors = errors | push : "The `speakers` collection does not seem to contain any entry. Have you accidentially renamed the collection or is your `_speakers/` folder empty?" -%}
{%- endif -%}
{%- assign room_size = site.rooms | size -%}
{%- if room_size == 0 -%}
{%- assign errors = errors | push : "The `rooms` collection does not seem to contain any entry. Have you accidentially renamed the collection or is your `_rooms/` folder empty?" -%}
{%- endif -%}

{% assign main_category_size = site.conference.talks.main_categories | size %}
{% if main_category_size == 0 %}
{% assign errors = errors | push : "Your `_config.yml` configuration file does not define any main category for your talks. Have you set the `conference.talks.main_categories` property? See also [Talk Settings](https://github.com/DigitaleGesellschaft/jekyll-theme-conference/#talk-settings) section in the theme's README file." %}
{% endif %}
{%- assign main_category_size = site.conference.talks.main_categories | size -%}
{%- if main_category_size == 0 -%}
{%- assign errors = errors | push : "Your `_config.yml` configuration file does not define any main category for your talks. Have you set the `conference.talks.main_categories` property? See also [Talk Settings](https://github.com/DigitaleGesellschaft/jekyll-theme-conference/#talk-settings) section in the theme's README file." -%}
{%- endif -%}
6 changes: 3 additions & 3 deletions _includes/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ <h5 class="modal-title" id="link-modal-label"></h5>
</div>
</div>

{% if site.conference.live.streaming %}
{% include partials/live-modal.html %}
{% endif %}
{%- if site.conference.live.streaming -%}
{%- include partials/live-modal.html -%}
{%- endif -%}

<!-- Append build time to avoid caching of live program embedded in JavaScript file -->
<script src="{{ site.baseurl }}/assets/js/main.js?t={{ site.time | date: "%s" }}"></script>
Expand Down
108 changes: 54 additions & 54 deletions _includes/partials/get_conf_time.html
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
{% for room in site.data.program %}
{% assign t = room.talks | first %}
{% include partials/get_talk_time.html %}

{% assign update_var = false %}

{% unless conf_start_hour %}
{% assign update_var = true %}
{% else %}
{% if talk_start_hour < conf_start_hour %}
{% assign update_var = true %}
{% elsif talk_start_hour == conf_start_hour and talk_start_min < conf_start_min %}
{% assign update_var = true %}
{% endif %}
{% endunless %}

{% if update_var %}
{% assign conf_start_hour = talk_start_hour %}
{% assign conf_start_min = talk_start_min %}
{% endif %}

{% assign t = room.talks | last %}
{% include partials/get_talk_time.html %}

{% assign update_var = false %}

{% unless conf_end_hour %}
{% assign update_var = true %}
{% else %}
{% if talk_end_hour > conf_end_hour %}
{% assign update_var = true %}
{% elsif talk_end_hour == conf_end_hour and talk_end_min > conf_end_min %}
{% assign update_var = true %}
{% endif %}
{% endunless %}

{% if update_var %}
{% assign conf_end_hour = talk_end_hour %}
{% assign conf_end_min = talk_end_min %}
{% endif %}
{% endfor %}

{% if conf_start_min < 10 %}
{% assign conf_start = conf_start_hour | append: ":0" | append: conf_start_min %}
{% else %}
{% assign conf_start = conf_start_hour | append: ":" | append: conf_start_min %}
{% endif %}
{% if conf_end_min < 10 %}
{% assign conf_end = conf_end_hour | append: ":0" | append: conf_end_min %}
{% else %}
{% assign conf_end = conf_end_hour | append: ":" | append: conf_end_min %}
{% endif %}

{% assign conf_duration_min = conf_end_hour | minus: conf_start_hour | times: 60 | minus: conf_start_min | plus: conf_end_min %}
{%- for room in site.data.program -%}
{%- assign t = room.talks | first -%}
{%- include partials/get_talk_time.html -%}

{%- assign update_var = false -%}

{%- unless conf_start_hour -%}
{%- assign update_var = true -%}
{%- else -%}
{%- if talk_start_hour < conf_start_hour -%}
{%- assign update_var = true -%}
{%- elsif talk_start_hour == conf_start_hour and talk_start_min < conf_start_min -%}
{%- assign update_var = true -%}
{%- endif -%}
{%- endunless -%}

{%- if update_var -%}
{%- assign conf_start_hour = talk_start_hour -%}
{%- assign conf_start_min = talk_start_min -%}
{%- endif -%}

{%- assign t = room.talks | last -%}
{%- include partials/get_talk_time.html -%}

{%- assign update_var = false -%}

{%- unless conf_end_hour -%}
{%- assign update_var = true -%}
{%- else -%}
{%- if talk_end_hour > conf_end_hour -%}
{%- assign update_var = true -%}
{%- elsif talk_end_hour == conf_end_hour and talk_end_min > conf_end_min -%}
{%- assign update_var = true -%}
{%- endif -%}
{%- endunless -%}

{%- if update_var -%}
{%- assign conf_end_hour = talk_end_hour -%}
{%- assign conf_end_min = talk_end_min -%}
{%- endif -%}
{%- endfor -%}

{%- if conf_start_min < 10 -%}
{%- assign conf_start = conf_start_hour | append: ":0" | append: conf_start_min -%}
{%- else -%}
{%- assign conf_start = conf_start_hour | append: ":" | append: conf_start_min -%}
{%- endif -%}
{%- if conf_end_min < 10 -%}
{%- assign conf_end = conf_end_hour | append: ":0" | append: conf_end_min -%}
{%- else -%}
{%- assign conf_end = conf_end_hour | append: ":" | append: conf_end_min -%}
{%- endif -%}

{%- assign conf_duration_min = conf_end_hour | minus: conf_start_hour | times: 60 | minus: conf_start_min | plus: conf_end_min -%}
82 changes: 41 additions & 41 deletions _includes/partials/get_link.html
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@

{% assign link_disabled = link.disabled %}
{% assign link_icon = link.icon %}
{% assign link_iframe = link.iframe %}
{%- assign link_disabled = link.disabled -%}
{%- assign link_icon = link.icon -%}
{%- assign link_iframe = link.iframe -%}

{% if link.absolute_url %}
{% assign link_href = link.absolute_url %}
{%- if link.absolute_url -%}
{%- assign link_href = link.absolute_url -%}

{% elsif link.relative_url %}
{% assign link_href = link.relative_url | prepend: site.baseurl %}
{%- elsif link.relative_url -%}
{%- assign link_href = link.relative_url | prepend: site.baseurl -%}

{% elsif link.file %}
{% assign link_icon = "file-alt" %}
{%- elsif link.file -%}
{%- assign link_icon = "file-alt" -%}

{% if talk %}
{% assign link_href = link.file | prepend: '/documents/slides/' | prepend: site.baseurl %}
{%- if talk -%}
{%- assign link_href = link.file | prepend: '/documents/slides/' | prepend: site.baseurl -%}

{% elsif speaker %}
{% assign link_href = link.file | prepend: '/documents/bio/' | prepend: site.baseurl %}
{%- elsif speaker -%}
{%- assign link_href = link.file | prepend: '/documents/bio/' | prepend: site.baseurl -%}

{% else %}
{% assign link_href = link.file | prepend: '/documents/' | prepend: site.baseurl %}
{%- else -%}
{%- assign link_href = link.file | prepend: '/documents/' | prepend: site.baseurl -%}

{% endif %}
{%- endif -%}

{% elsif link.video %}
{% assign link_href = link.video %}
{% assign link_icon = "video" %}
{% assign link_iframe = true %}
{%- elsif link.video -%}
{%- assign link_href = link.video -%}
{%- assign link_icon = "video" -%}
{%- assign link_iframe = true -%}

{% if talk %}
{% capture modal_header %}
{%- if talk -%}
{%- capture modal_header -%}
<h3 class="font-weight-light">
{% if talk.hide %}
{%- if talk.hide -%}
{{ talk.name }}
{% else %}
{%- else -%}
<a class="text-reset" href="{{ talk.url | prepend: site.baseurl }}">
{{ talk.name }}
</a>
{% endif %}
{%- endif -%}
</h3>
<p class="mb-0 font-weight-light">
{% include partials/list_speakers.html %}
{%- include partials/list_speakers.html -%}
</p>
{% endcapture %}
{%- endcapture -%}

{% elsif speaker %}
{% capture modal_header %}
{%- elsif speaker -%}
{%- capture modal_header -%}
<h3 class="mb-0 font-weight-light">
{% if speaker.hide %}
{%- if speaker.hide -%}
{{ speaker.first_name }} {{ speaker.last_name }}
{% else %}
{%- else -%}
<a class="text-reset" href="{{ speaker.url | prepend: site.baseurl }}">
{{ speaker.first_name }} {{ speaker.last_name }}
</a>
{% endif %}
{%- endif -%}
</h3>
{% endcapture %}
{% assign modal_desc = link.name %}
{%- endcapture -%}
{%- assign modal_desc = link.name -%}

{% endif %}
{%- endif -%}

{% else %}
{% assign link_disabled = true %}
{%- else -%}
{%- assign link_disabled = true -%}

{% endif %}
{%- endif -%}

{% capture link_tag -%}
{%- capture link_tag -%}
{%- if link.disabled -%}
<a class="disabled{% if link_styleclass %} {{ link_styleclass }}{% endif %}" href="#">

Expand All @@ -88,6 +88,6 @@ <h3 class="mb-0 font-weight-light">
<a{% if link_styleclass %} class="{{ link_styleclass }}"{% endif %} href="{{ link_href }}" title="{{ link.name }}">

{%- endif -%}
{%- endcapture %}
{%- endcapture -%}

{% assign link_styleclass = "" %}
{%- assign link_styleclass = "" -%}
28 changes: 14 additions & 14 deletions _includes/partials/get_link_types.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{% if talk %}
{% assign links = talk.links%}
{% else if speaker %}
{% assign links = speaker.links%}
{% endif %}
{%- if talk -%}
{%- assign links = talk.links -%}
{%- else if speaker -%}
{%- assign links = speaker.links -%}
{%- endif -%}

{% assign has_icon_links = false %}
{% assign has_regular_links = false %}
{% for link in links %}
{% if link.icon or link.file or link.video %}
{% assign has_icon_links = true %}
{% else %}
{% assign has_regular_links = true %}
{% endif %}
{% endfor %}
{%- assign has_icon_links = false -%}
{%- assign has_regular_links = false -%}
{%- for link in links -%}
{%- if link.icon or link.file or link.video -%}
{%- assign has_icon_links = true -%}
{%- else -%}
{%- assign has_regular_links = true -%}
{%- endif -%}
{%- endfor -%}
18 changes: 9 additions & 9 deletions _includes/partials/get_main_category.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% for main_cat in site.conference.talks.main_categories %}
{% for cat in talk.categories %}
{% if cat == main_cat.name %}
{% assign main_cat = main_cat.name %}
{% assign main_cat_color = main_cat.color %}
{% break %}
{% endif %}
{% endfor %}
{% endfor %}
{%- for main_cat in site.conference.talks.main_categories -%}
{%- for cat in talk.categories -%}
{%- if cat == main_cat.name -%}
{%- assign main_cat = main_cat.name -%}
{%- assign main_cat_color = main_cat.color -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
14 changes: 7 additions & 7 deletions _includes/partials/get_talk_time.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% assign talk_start = t.time_start %}
{% assign talk_end = t.time_end %}
{%- assign talk_start = t.time_start -%}
{%- assign talk_end = t.time_end -%}

{% assign talk_start_hour = talk_start | split: ':' | first %}
{% assign talk_start_min = talk_start | split: ':' | last | divided_by: site.conference.program.time_steps | floor | times: site.conference.program.time_steps %}
{% assign talk_end_hour = talk_end | split: ':' | first %}
{% assign talk_end_min = talk_end | split: ':' | last | divided_by: site.conference.program.time_steps | ceil | times: site.conference.program.time_steps %}
{%- assign talk_start_hour = talk_start | split: ':' | first -%}
{%- assign talk_start_min = talk_start | split: ':' | last | divided_by: site.conference.program.time_steps | floor | times: site.conference.program.time_steps -%}
{%- assign talk_end_hour = talk_end | split: ':' | first -%}
{%- assign talk_end_min = talk_end | split: ':' | last | divided_by: site.conference.program.time_steps | ceil | times: site.conference.program.time_steps -%}

{% assign talk_duration_min = talk_end_hour | minus: talk_start_hour | times: 60 | minus: talk_start_min | plus: talk_end_min %}
{%- assign talk_duration_min = talk_end_hour | minus: talk_start_hour | times: 60 | minus: talk_start_min | plus: talk_end_min -%}
8 changes: 4 additions & 4 deletions _includes/partials/get_timestamp.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% assign datetime_start = site.conference.live.date | append: " " | append: time_start | append: " " | append: site.conference.live.timezone %}
{% assign timestamp_start = datetime_start | date: "%s" %}
{% assign datetime_end = site.conference.live.date | append: " " | append: time_end | append: " " | append: site.conference.live.timezone %}
{% assign timestamp_end = datetime_end | date: "%s" %}
{%- assign datetime_start = site.conference.live.date | append: " " | append: time_start | append: " " | append: site.conference.live.timezone -%}
{%- assign timestamp_start = datetime_start | date: "%s" -%}
{%- assign datetime_end = site.conference.live.date | append: " " | append: time_end | append: " " | append: site.conference.live.timezone -%}
{%- assign timestamp_end = datetime_end | date: "%s" -%}

0 comments on commit 9ea7bf0

Please sign in to comment.