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 Nov 22, 2021
1 parent 37245cd commit d82d872
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 26 deletions.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ future: false # Workaround for SeaGL/seagl.github.io#170
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
11 changes: 7 additions & 4 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{% comment %} Workaround for https://github.com/Shopify/liquid/issues/1034 {% endcomment %}
{% assign nav = nil %}{% if page contains "nav" %}{% assign nav = page.nav %}{% endif %}

{% assign sponsor_year = site.sponsor-years | last %}

<nav class="navbar navbar-default" role="navigation" id="main-nav">
Expand All @@ -15,13 +18,13 @@

<div id="main-nav-container" class="collapse navbar-collapse top-nav-collapse">
<ul class="nav pull-left navbar-nav main-nav-links inline-list">
<li {% if page.nav == "home" %} class="active" | {% endif %} ><a href="/">Home</a></li>
<li {% if page.nav == "get_involved" %} class="active" | {% endif %} ><a href="/get_involved.html">Get Involved</a></li>
<li {% if nav == "home" %} class="active" | {% endif %} ><a href="/">Home</a></li>
<li {% if nav == "get_involved" %} class="active" | {% endif %} ><a href="/get_involved.html">Get Involved</a></li>
</ul>

<ul class="nav pull-right navbar-nav main-nav-links inline-list">
<li {% if page.nav == "sponsors" %} class="active" | {% endif %} ><a href="{{ sponsor_year.url }}">Sponsors</a></li>
<li {% if page.nav == "archive" %} class="active" | {% endif %} ><a href="/archive">Archive</a></li>
<li {% if nav == "sponsors" %} class="active" | {% endif %} ><a href="{{ sponsor_year.url }}">Sponsors</a></li>
<li {% if nav == "archive" %} class="active" | {% endif %} ><a href="/archive">Archive</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
4 changes: 2 additions & 2 deletions _layouts/archive/conference.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ <h2>{{ day.name }}</h2>
<div>
<a href="{{ session.url }}">{{ session.title }}</a>

{% if session.keynote %}
{% if session contains 'keynote' and session.keynote %}
<span class="label label-default">Keynote</span>
{% endif %}
</div>

{% 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
22 changes: 11 additions & 11 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 All @@ -41,7 +41,7 @@
<h2>{{ session.title }}</h2>

<p>
{% if session.keynote %}
{% if session contains 'keynote' and session.keynote %}
<span class="label label-default">Keynote</span>
{% endif %}
</p>
Expand All @@ -50,7 +50,7 @@ <h2>{{ session.title }}</h2>
</div>

<div class="col-xs-12 col-md-5">
{% if session.presenters %}
{% if session contains 'presenters' %}
<h3>Presenters</h3>

{% for presenter in session.presenters %}
Expand All @@ -59,32 +59,32 @@ <h3>Presenters</h3>
<img class="img-circle" width="64" height="64" alt="{{ presenter.name }}" src="https://s.gravatar.com/avatar/{{ presenter.gravatar_id }}?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>
<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>
{{ presenter.biography | markdownify }}
</div>
</div>
{% endfor %}
{% endif %}

{% if session.resources %}
{% if session contains resources %}
<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
6 changes: 3 additions & 3 deletions _layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset='utf-8' />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{% if page.description %}<meta name="description" content="{{ page.description }}" />{% endif %}
{% if page contains "description" %}<meta name="description" content="{{ page.description }}" />{% endif %}

<link rel="alternate" type="application/rss+xml" title="{{ site.name }} RSS" href="{{ site.origin }}/feed.xml" />
<link rel="image_src" href="{{ site.origin }}/img/logo.png" />
Expand All @@ -29,13 +29,13 @@
<link rel="stylesheet" type="text/css" media="screen" href="/css/app/ribbon.css">
<link rel="stylesheet" type="text/css" media="screen" href="/css/app/style_guide.css">

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

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

<body id="{{ page.body_id }}">
<body id="{% if page contains "body_id" %}{{ page.body_id }}{% endif %}">
{{ content }}
</body>
</html>
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
6 changes: 3 additions & 3 deletions _layouts/sponsors.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ <h2>{{ level[1] }}</h2>
{% for sponsor in sponsors %}
{% for sponsorship in sponsor.sponsorships %}
{% if sponsorship[0] == year and sponsorship[1] == level[0] %}
<a class="logo-wall-item {% if sponsor.logo.horizontal %}horizontal{% endif %}" href="{{ sponsor.url }}">
{% if sponsor.logo.horizontal %}
<a class="logo-wall-item {% if sponsor.logo contains 'horizontal' %}horizontal{% endif %}" href="{{ sponsor.url }}">
{% if sponsor.logo contains 'horizontal' %}
<img src="{{ sponsor.logo.horizontal }}" alt="{{ sponsor.name }}">
{% elsif sponsor.logo.square %}
{% elsif sponsor.logo contains 'square' %}
<img src="{{ sponsor.logo.square }}" alt="{{ sponsor.name }}">
{% else %}
{{ sponsor.name }}
Expand Down
2 changes: 1 addition & 1 deletion archive.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2>
<a href="{{ conference.url }}">SeaGL {{ year }}</a>
</h2>

{% if conference.subtitle %}
{% if conference contains 'subtitle' %}
<div style="font-style: italic;">{{ conference.subtitle }}</div>
{% endif %}
</div>
Expand Down
1 change: 1 addition & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: page
nav: home
body_id: home
title: Seattle GNU/Linux Conference
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.
---

Expand Down
1 change: 1 addition & 0 deletions meet.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: page
redirect_from:
- /chat
title: Community Chat
---

<div class="row"><div class="col col-md-10 col-md-offset-1" markdown="1">
Expand Down

0 comments on commit d82d872

Please sign in to comment.