Skip to content

Commit 01e7422

Browse files
Showing better layout when no sponsor is present
1 parent 3d099c7 commit 01e7422

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

_layouts/post.html

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@
1818
<h2>{{ page.title }}</h2>
1919
<p>{{ page.content }}</p>
2020

21-
<div class="infobox post__sponsor-box">
22-
<a href="{{ sponsor.link }}">
23-
<img class="post__sponsor-img"
24-
src="{{ site.baseurl }}/{{ sponsor.logo }}"
25-
alt="Sponsor logo">
26-
</a>
27-
<p>Thanks to <a href="{{ sponsor.link }}">{{ sponsor.name }}</a> for hosting this event!</p>
28-
<p>{{ sponsor.content }}</p>
29-
</div>
21+
{% if sponsor %}
22+
<div class="infobox post__sponsor-box">
23+
<a href="{{ sponsor.link }}">
24+
<img class="post__sponsor-img"
25+
src="{{ site.baseurl }}/{{ sponsor.logo }}"
26+
alt="Sponsor logo">
27+
</a>
28+
<p>Thanks to <a href="{{ sponsor.link }}">{{ sponsor.name }}</a> for hosting this event!</p>
29+
<p>{{ sponsor.content }}</p>
30+
</div>
31+
{% endif %}
3032

3133
{% if project.name %}
3234
{% if project.logo %}
@@ -48,22 +50,24 @@ <h3><i class="fas fa-info-circle"></i> Information</h3>
4850
<p><b>Level:</b> {{ page.level }}</p>
4951
<p><b>Date:</b> {{ page.date | date: "%e %B %Y" }}</p>
5052
<p><b>Time:</b> {{ page.time }}</p>
51-
<p>
52-
<b>Address:</b><br/>
53-
{{ sponsor.name }}<br/>
54-
{{ sponsor.address }}
55-
<div id="chapters__map"></div>
56-
{% comment %}
57-
Create a javascript variable for use in the function adding map markers.
58-
{% endcomment %}
59-
{% assign locations = "" | split: ',' %}
60-
{% assign location = page %}
61-
{% assign locations = locations | push: location %}
62-
{% include locations_variable_generator.html locations_array = locations %}
63-
<script async defer
64-
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB0NCzoIqGkYFdpRl-LmgWTKpxPBkqxxO0&callback=initMap">
65-
</script>
66-
</p>
53+
{% if sponsor %}
54+
<p>
55+
<b>Address:</b><br/>
56+
{{ sponsor.name }}<br/>
57+
{{ sponsor.address }}
58+
<div id="chapters__map"></div>
59+
{% comment %}
60+
Create a javascript variable for use in the function adding map markers.
61+
{% endcomment %}
62+
{% assign locations = "" | split: ',' %}
63+
{% assign location = page %}
64+
{% assign locations = locations | push: location %}
65+
{% include locations_variable_generator.html locations_array = locations %}
66+
<script async defer
67+
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB0NCzoIqGkYFdpRl-LmgWTKpxPBkqxxO0&callback=initMap">
68+
</script>
69+
</p>
70+
{% endif %}
6771
</div>
6872
</div>
6973
</div>

0 commit comments

Comments
 (0)