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 Sep 15, 2021
1 parent 50bb71d commit f3d3707
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 27 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,14 +18,14 @@

<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 nav == "home" %} class="active" | {% endif %} ><a href="/">Home</a></li>
<li><a href="{{ site.custom.url.cfp }}">CFP</a></li>
<!-- <li {% if page.nav == "schedule" %} class="active" | {% endif %} ><a href="/schedule/{{ site.custom.year }}.html">Schedule</a></li> -->
<!-- <li {% if nav == "schedule" %} class="active" | {% endif %} ><a href="/schedule/{{ site.custom.year }}.html">Schedule</a></li> -->
</ul>

<ul class="nav pull-right navbar-nav main-nav-links inline-list">
<li {% if page.nav == "get_involved" %} class="active" | {% endif %} ><a href="/get_involved.html">Get Involved</a></li>
<li {% if page.nav == "sponsors" %} class="active" | {% endif %} ><a href="{{ sponsor_year.url }}">Sponsors</a></li>
<li {% if nav == "get_involved" %} class="active" | {% endif %} ><a href="/get_involved.html">Get Involved</a></li>
<li {% if nav == "sponsors" %} class="active" | {% endif %} ><a href="{{ sponsor_year.url }}">Sponsors</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</nav>
6 changes: 3 additions & 3 deletions _layouts/archive/conference.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<h1 class="text-center">
SeaGL {{ year }}

{% if conference.theme %}
{% if conference contains 'theme' %}
<span class="subtitle">{{ conference.theme }}</>
{% endif %}
</h1>
Expand All @@ -32,14 +32,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
24 changes: 12 additions & 12 deletions _layouts/archive/session.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
{% capture year %}{{ session.beginning | date: '%Y' }}{% endcapture %}

<div class="col-xs-12 col-lg-10 col-lg-push-1">
{% if session.resources %}
{% if session.resources.internet_archive_identifier %}
{% if session contains 'resources' %}
{% 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 @@ -18,7 +18,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 @@ -40,7 +40,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 @@ -55,31 +55,31 @@ <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 %}
{% endif %}

{% if session.resources %}
{% if session contains 'resources' %}
<h3>Resources</h3>

<ul>
{% 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 @@ -28,13 +28,13 @@
<link rel="stylesheet" type="text/css" media="screen" href="/css/app/code_of_conduct.css">
<link rel="stylesheet" type="text/css" media="screen" href="/css/app/ribbon.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 @@ -14,13 +14,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
4 changes: 2 additions & 2 deletions _layouts/sponsors.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ <h2>{{ level[1] }}</h2>
{% 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 %}
{% 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 @@ -16,7 +16,7 @@ <h2>
<a href="{{ conference.url }}">SeaGL {{ year }}</a>
</h2>

{% if conference.theme %}
{% if conference contains 'theme' %}
<div style="font-style: italic;">
{{ conference.theme }}
</div>
Expand Down
1 change: 1 addition & 0 deletions index.html
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.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
layout: page
title: Community Chat
redirect_from:
- /chat
---
Expand Down

0 comments on commit f3d3707

Please sign in to comment.