Skip to content

Commit

Permalink
Fail the build on templating errors and undefined variables
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewKvalheim committed Oct 15, 2022
1 parent ebd4634 commit 036ca42
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 14 deletions.
13 changes: 13 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ future: false # Restore default behavior of Jekyll overridden by https:/
timezone: America/Los_Angeles
markdown: kramdown
highlighter: rouge
liquid:
error_mode: strict
strict_filters: true
strict_variables: true

# Allowed plugins: https://pages.github.com/versions/
plugins: &plugins
Expand Down Expand Up @@ -36,14 +40,23 @@ collections:
permalink: /sponsors/:path

defaults:
- scope: { path: "" }
values:
body_id: null # Workaround for Shopify/liquid#1034
description: null # Workaround for Shopify/liquid#1034
nav: null # Workaround for Shopify/liquid#1034
- scope: { type: archive-conferences }
values:
layout: archive/conference
nav: archive
subtitle: null # Workaround for Shopify/liquid#1034
- scope: { type: archive-sessions }
values:
layout: archive/session
nav: archive
keynote: null # Workaround for Shopify/liquid#1034
presenters: null # Workaround for Shopify/liquid#1034
resources: null # Workaround for Shopify/liquid#1034
- scope: { type: sponsor-years }
values:
body_id: sponsors
Expand Down
4 changes: 2 additions & 2 deletions _layouts/archive/conference.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| where_exp: 'session', 'session.relative_path contains path_prefix'
| sort: 'beginning'
| group_by_exp: 'session', 'session.beginning | date: "%A"' %}
{% assign posts = site.tags[year] | where: 'categories','news' | reverse %}
{% if site.tags contains year %}{% assign posts = site.tags[year] | where: 'categories','news' | reverse %}{% else %}{% assign posts = empty %}{% endif %}

<div class="row">
<div class="col-xs-12 col-lg-10 col-lg-push-1">
Expand Down Expand Up @@ -41,7 +41,7 @@ <h2>{{ day.name }}</h2>

{% for presenter in session.presenters %}
<div>
{{ presenter.name }}{% if presenter.affiliation %}<span class="text-muted">, {{ presenter.affiliation }}</span>{% endif %}
{{ presenter.name }}{% if presenter contains 'affiliation' %}<span class="text-muted">, {{ presenter.affiliation }}</span>{% endif %}
</div>
{% endfor %}
</li>
Expand Down
20 changes: 10 additions & 10 deletions _layouts/archive/session.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="row">
<div class="col-xs-12 col-lg-10 col-lg-push-1">
{% if session.resources %}
{% if session.resources.internet_archive_identifier %}
{% if session.resources contains 'internet_archive_identifier' %}
<figure>
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://archive.org/embed/{{ session.resources.internet_archive_identifier }}" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
Expand All @@ -19,7 +19,7 @@
If you value their service, please consider thanking them with a small donation.
</figcaption>
</figure>
{% elsif session.resources.youtube_id %}
{% elsif session.resources contains 'youtube_id' %}
<figure>
<div class="embed-responsive embed-responsive-16by9">
<div class="embed-responsive-item embed-placeholder">
Expand Down Expand Up @@ -58,11 +58,11 @@ <h3>Presenters</h3>
{% for presenter in session.presenters %}
<div class="media">
<div class="media-left">
<img class="img-circle" width="64" height="64" alt="{{ presenter.name }}" src="https://s.gravatar.com/avatar/{{ presenter.gravatar_id }}?d=mp&s=128">
<img class="img-circle" width="64" height="64" alt="{{ presenter.name }}" src="https://s.gravatar.com/avatar/{% if presenter contains 'gravatar_id' %}{{ presenter.gravatar_id }}{% endif %}?d=mp&s=128">
</div>
<div class="media-body media-middle">
<h4 class="media-heading">{{ presenter.name }}{% if presenter.pronouns %}<span class="text-muted"> ({{ presenter.pronouns }})</span>{% endif %}{% if presenter.affiliation %}<span class="text-muted">, {{ presenter.affiliation }}</span>{% endif %}</h4>
{{ presenter.biography | markdownify }}
<h4 class="media-heading">{{ presenter.name }}{% if presenter contains 'pronouns' %}<span class="text-muted"> ({{ presenter.pronouns }})</span>{% endif %}{% if presenter contains 'affiliation' %}<span class="text-muted">, {{ presenter.affiliation }}</span>{% endif %}</h4>
{% if presenter contains 'biography' %}{{ presenter.biography | markdownify }}{% endif %}
</div>
</div>
{% endfor %}
Expand All @@ -72,21 +72,21 @@ <h4 class="media-heading">{{ presenter.name }}{% if presenter.pronouns %}<span c
<h3>Resources</h3>

<ul>
{% if session.resources.resources_url %}
{% if session.resources contains 'resources_url' %}
<li><a href="{{ session.resources.resources_url }}">Resources</a></li>
{% endif %}

{% if session.resources.slides_url %}
{% if session.resources contains 'slides_url' %}
<li><a href="{{ session.resources.slides_url }}">Slides</a></li>
{% endif %}

{% if session.resources.internet_archive_identifier %}
{% if session.resources contains 'internet_archive_identifier' %}
<li><a href="https://archive.org/details/{{ session.resources.internet_archive_identifier }}">Video Recording</a></li>
{% elsif session.resources.youtube_id %}
{% elsif session.resources contains 'youtube_id' %}
<li><a href="https://youtu.be/{{ session.resources.youtube_id }}">Video Recording</a></li>
{% endif %}

{% if session.resources.audio_url %}
{% if session.resources contains 'audio_url' %}
<li><a href="{{ session.resources.audio_url }}">Audio Recording</a></li>
{% endif %}
</ul>
Expand Down
4 changes: 2 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

<div class="row">
<div class="col-md-6">
{% if page.previous.url %}
{% if page.previous %}
<a class="prev" href="{{page.previous.url}}">&laquo; {{page.previous.title}}</a>
{% endif %}
</div>

<div class="col-md-6 text-right">
{% if page.next.url %}
{% if page.next %}
<a class="next" href="{{page.next.url}}">{{page.next.title}} &raquo;</a>
{% endif %}
</div>
Expand Down

0 comments on commit 036ca42

Please sign in to comment.