Skip to content

Commit f3d3707

Browse files
Fail the build on templating errors and undefined variables
1 parent 50bb71d commit f3d3707

File tree

10 files changed

+36
-27
lines changed

10 files changed

+36
-27
lines changed

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ future: false # Workaround for SeaGL/seagl.github.io#170
44
timezone: America/Los_Angeles
55
markdown: kramdown
66
highlighter: rouge
7+
liquid:
8+
error_mode: strict
9+
strict_filters: true
10+
strict_variables: true
711

812
# Allowed plugins: https://pages.github.com/versions/
913
plugins: &plugins

_includes/header.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
{% comment %} Workaround for https://github.com/Shopify/liquid/issues/1034 {% endcomment %}
2+
{% assign nav = nil %}{% if page contains "nav" %}{% assign nav = page.nav %}{% endif %}
3+
14
{% assign sponsor_year = site.sponsor-years | last %}
25

36
<nav class="navbar navbar-default" role="navigation" id="main-nav">
@@ -15,14 +18,14 @@
1518

1619
<div id="main-nav-container" class="collapse navbar-collapse top-nav-collapse">
1720
<ul class="nav pull-left navbar-nav main-nav-links inline-list">
18-
<li {% if page.nav == "home" %} class="active" | {% endif %} ><a href="/">Home</a></li>
21+
<li {% if nav == "home" %} class="active" | {% endif %} ><a href="/">Home</a></li>
1922
<li><a href="{{ site.custom.url.cfp }}">CFP</a></li>
20-
<!-- <li {% if page.nav == "schedule" %} class="active" | {% endif %} ><a href="/schedule/{{ site.custom.year }}.html">Schedule</a></li> -->
23+
<!-- <li {% if nav == "schedule" %} class="active" | {% endif %} ><a href="/schedule/{{ site.custom.year }}.html">Schedule</a></li> -->
2124
</ul>
2225

2326
<ul class="nav pull-right navbar-nav main-nav-links inline-list">
24-
<li {% if page.nav == "get_involved" %} class="active" | {% endif %} ><a href="/get_involved.html">Get Involved</a></li>
25-
<li {% if page.nav == "sponsors" %} class="active" | {% endif %} ><a href="{{ sponsor_year.url }}">Sponsors</a></li>
27+
<li {% if nav == "get_involved" %} class="active" | {% endif %} ><a href="/get_involved.html">Get Involved</a></li>
28+
<li {% if nav == "sponsors" %} class="active" | {% endif %} ><a href="{{ sponsor_year.url }}">Sponsors</a></li>
2629
</ul>
2730
</div><!-- /.navbar-collapse -->
2831
</nav>

_layouts/archive/conference.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<h1 class="text-center">
1515
SeaGL {{ year }}
1616

17-
{% if conference.theme %}
17+
{% if conference contains 'theme' %}
1818
<span class="subtitle">{{ conference.theme }}</>
1919
{% endif %}
2020
</h1>
@@ -32,14 +32,14 @@ <h2>{{ day.name }}</h2>
3232
<div>
3333
<a href="{{ session.url }}">{{ session.title }}</a>
3434

35-
{% if session.keynote %}
35+
{% if session contains 'keynote' and session.keynote %}
3636
<span class="label label-default">Keynote</span>
3737
{% endif %}
3838
</div>
3939

4040
{% for presenter in session.presenters %}
4141
<div>
42-
{{ presenter.name }}{% if presenter.affiliation %}<span class="text-muted">, {{ presenter.affiliation }}</span>{% endif %}
42+
{{ presenter.name }}{% if presenter contains 'affiliation' %}<span class="text-muted">, {{ presenter.affiliation }}</span>{% endif %}
4343
</div>
4444
{% endfor %}
4545
</li>

_layouts/archive/session.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
{% capture year %}{{ session.beginning | date: '%Y' }}{% endcapture %}
77

88
<div class="col-xs-12 col-lg-10 col-lg-push-1">
9-
{% if session.resources %}
10-
{% if session.resources.internet_archive_identifier %}
9+
{% if session contains 'resources' %}
10+
{% if session.resources contains 'internet_archive_identifier' %}
1111
<figure>
1212
<div class="embed-responsive embed-responsive-16by9">
1313
<iframe class="embed-responsive-item" src="https://archive.org/embed/{{ session.resources.internet_archive_identifier }}" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
@@ -18,7 +18,7 @@
1818
If you value their service, please consider thanking them with a small donation.
1919
</figcaption>
2020
</figure>
21-
{% elsif session.resources.youtube_id %}
21+
{% elsif session.resources contains 'youtube_id' %}
2222
<figure>
2323
<div class="embed-responsive embed-responsive-16by9">
2424
<div class="embed-responsive-item embed-placeholder">
@@ -40,7 +40,7 @@
4040
<h2>{{ session.title }}</h2>
4141

4242
<p>
43-
{% if session.keynote %}
43+
{% if session contains 'keynote' and session.keynote %}
4444
<span class="label label-default">Keynote</span>
4545
{% endif %}
4646
</p>
@@ -55,31 +55,31 @@ <h3>Presenters</h3>
5555
{% for presenter in session.presenters %}
5656
<div class="media">
5757
<div class="media-left">
58-
<img class="img-circle" width="64" height="64" alt="{{ presenter.name }}" src="https://s.gravatar.com/avatar/{{ presenter.gravatar_id }}?d=mp&s=128">
58+
<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">
5959
</div>
6060
<div class="media-body media-middle">
61-
<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>
62-
{{ presenter.biography | markdownify }}
61+
<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>
62+
{% if presenter contains 'biography' %}{{ presenter.biography | markdownify }}{% endif %}
6363
</div>
6464
</div>
6565
{% endfor %}
6666
{% endif %}
6767

68-
{% if session.resources %}
68+
{% if session contains 'resources' %}
6969
<h3>Resources</h3>
7070

7171
<ul>
72-
{% if session.resources.slides_url %}
72+
{% if session.resources contains 'slides_url' %}
7373
<li><a href="{{ session.resources.slides_url }}">Slides</a></li>
7474
{% endif %}
7575

76-
{% if session.resources.internet_archive_identifier %}
76+
{% if session.resources contains 'internet_archive_identifier' %}
7777
<li><a href="https://archive.org/details/{{ session.resources.internet_archive_identifier }}">Video Recording</a></li>
78-
{% elsif session.resources.youtube_id %}
78+
{% elsif session.resources contains 'youtube_id' %}
7979
<li><a href="https://youtu.be/{{ session.resources.youtube_id }}">Video Recording</a></li>
8080
{% endif %}
8181

82-
{% if session.resources.audio_url %}
82+
{% if session.resources contains 'audio_url' %}
8383
<li><a href="{{ session.resources.audio_url }}">Audio Recording</a></li>
8484
{% endif %}
8585
</ul>

_layouts/base.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset='utf-8' />
66
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8-
{% if page.description %}<meta name="description" content="{{ page.description }}" />{% endif %}
8+
{% if page contains "description" %}<meta name="description" content="{{ page.description }}" />{% endif %}
99

1010
<link rel="alternate" type="application/rss+xml" title="{{ site.name }} RSS" href="{{ site.origin }}/feed.xml" />
1111
<link rel="image_src" href="{{ site.origin }}/img/logo.png" />
@@ -28,13 +28,13 @@
2828
<link rel="stylesheet" type="text/css" media="screen" href="/css/app/code_of_conduct.css">
2929
<link rel="stylesheet" type="text/css" media="screen" href="/css/app/ribbon.css">
3030

31-
<title>{% if page.title %}{{ page.title }} | {% endif %}Seattle GNU/Linux Conference</title>
31+
<title>{{ page.title }}{% unless page.title contains site.name %} | {{ site.name }}{% endunless %}</title>
3232

3333
<script src="/js/jquery.min.js"></script>
3434
<script src="/js/vendor/bootstrap-3.3.7.min.js"></script>
3535
</head>
3636

37-
<body id="{{ page.body_id }}">
37+
<body id="{% if page contains "body_id" %}{{ page.body_id }}{% endif %}">
3838
{{ content }}
3939
</body>
4040
</html>

_layouts/post.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
<div class="row">
1616
<div class="col-md-6">
17-
{% if page.previous.url %}
17+
{% if page.previous %}
1818
<a class="prev" href="{{page.previous.url}}">&laquo; {{page.previous.title}}</a>
1919
{% endif %}
2020
</div>
2121

2222
<div class="col-md-6 text-right">
23-
{% if page.next.url %}
23+
{% if page.next %}
2424
<a class="next" href="{{page.next.url}}">{{page.next.title}} &raquo;</a>
2525
{% endif %}
2626
</div>

_layouts/sponsors.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ <h2>{{ level[1] }}</h2>
3636
{% for sponsorship in sponsor.sponsorships %}
3737
{% if sponsorship[0] == year and sponsorship[1] == level[0] %}
3838
<a class="logo-wall-item {% if sponsor.logo.horizontal %}horizontal{% endif %}" href="{{ sponsor.url }}">
39-
{% if sponsor.logo.horizontal %}
39+
{% if sponsor.logo contains 'horizontal' %}
4040
<img src="{{ sponsor.logo.horizontal }}" alt="{{ sponsor.name }}">
41-
{% elsif sponsor.logo.square %}
41+
{% elsif sponsor.logo contains 'square' %}
4242
<img src="{{ sponsor.logo.square }}" alt="{{ sponsor.name }}">
4343
{% else %}
4444
{{ sponsor.name }}

archive.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ <h2>
1616
<a href="{{ conference.url }}">SeaGL {{ year }}</a>
1717
</h2>
1818

19-
{% if conference.theme %}
19+
{% if conference contains 'theme' %}
2020
<div style="font-style: italic;">
2121
{{ conference.theme }}
2222
</div>

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: page
33
nav: home
44
body_id: home
5+
title: Seattle GNU/Linux Conference
56
description: SeaGL is a grassroots technical conference dedicated to spreading awareness and knowledge about the GNU/Linux community and free/libre/open-source software/hardware.
67
---
78

meet.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
layout: page
3+
title: Community Chat
34
redirect_from:
45
- /chat
56
---

0 commit comments

Comments
 (0)