forked from python-sprints/python-sprints.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfooter.html
More file actions
68 lines (65 loc) · 3.2 KB
/
footer.html
File metadata and controls
68 lines (65 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<footer class="footer">
<div class="row container-fluid">
<div class="col-md-3 text-center">
<h2 class="footer__section-title">Find Us Online</h2>
<hr class="footer__divider">
<a href="https://www.meetup.com/Python-Sprints/" target="_blank"><i class="footer__icon fab fa-meetup"></i></a>
<a href="https://twitter.com/py_sprints" target="_blank"><i class="footer__icon fab fa-twitter"></i></a>
</div>
<div class="col-md-6">
<h2 class="footer__section-title">Our Sponsors</h2>
<hr class="footer__divider">
{% comment %}
Assume number of sponsors is even. We are going to create rows of 2 sponsors in each.
If not even the last row must contain 1 sponsor and be terminated with appropriate tags.
{% endcomment %}
{% assign num_of_sponsors_even = true %}
{% assign sponsors = "" | split: ',' %}
{% for sponsor in site.sponsors %}
{% assign sponsors = sponsors | push: sponsor %}
{% endfor %}
{% assign num_of_sponsors = sponsors | size %}
{% if num_of_sponsors | modulo: 2 > 0 %}
{% assign num_of_sponsors_even = false %}
{% endif %}
{% assign num_of_rows = num_of_sponsors | divided_by: 2 | floor %}
{% assign items_per_row = 1 %}
{% for row in (0..num_of_rows) %}
{% if forloop.last == true and num_of_sponsors_even == false %}
{% assign items_per_row = 0 %}
{% endif %}
<div class="row">
{% for col in (0..items_per_row) %}
{% assign sponsor_index = row | times: 2 | plus: col %}
{% assign sponsor = sponsors[sponsor_index] %}
<div class="footer__sponsor-col col-md-12 col-lg-6">
<a class="footer__sponsor-link" href="{{ sponsor.sponsor_link }}">
<img class="footer__img" src="{{ site.baseurl }}/{{ sponsor.sponsor_logo }}">
</a>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
<div class="col-md-3">
<h2 class="footer__section-title">Python Sprints</h2>
<hr class="footer__divider">
<a class="footer__link" href="{{ '/' | prepend: site.baseurl }}">Home</a>
{% for page in site.pages %}
{% if page.title %}
<a class="footer__link" href="{{ page.url | prepend: site.baseurl }}">{{ page.title }}</a>
{% endif %}
{% endfor %}
</div>
</div>
<div class="footer__content row container-fluid">
<div class="col-md-12">
<p class="footer__text-copyright">
© Copyright
<script>document.write(new Date().getFullYear())</script>
- Python Sprints
<img class="footer__brand-img" src="{{ site.baseurl }}/static/images/site_logo/python_sprints_logo.png" alt="Python Sprints Logo">
</p>
</div>
</div>
</footer>