Skip to content

Commit c0b49f5

Browse files
Added project_logo variable to post.
Styled upcoming event. Test injecting event sponsors into upcoming event. Restructured upcoming event layout.
1 parent c4c4534 commit c0b49f5

File tree

3 files changed

+129
-21
lines changed

3 files changed

+129
-21
lines changed

_posts/2018-03-10-Pandas-Documentation-Sprint.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ layout: post
33
title: Pandas documentation sprint (worldwide)
44
project: Pandas
55
project_description: Powerful Python data analysis toolkit
6+
project_logo: static/images/events/pandas_logo_donation.png
7+
project_link: http://pandas.pydata.org/index.html
68
date: 2018-03-10
79
venue: Bloomberg (London)
810
meetup_link: https://www.meetup.com/Python-Sprints/events/247097848/
911
event_link: https://python-sprints.github.io/pandas/
1012
image: static/images/events/pandas_documentation_sprint_1280_720px.jpg
11-
project_logo: static/images/events/pandas_logo_donation.png
1213

1314
sponsors:
1415
- bloomberg

_sass/style.scss

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -297,22 +297,22 @@ a {
297297
}
298298

299299
.upcoming__col {
300-
margin-top: 1%;
300+
margin-top: 1em;
301301
background: rgba(0, 0, 0, 0.7);
302-
border-radius: 20px 5px 20px 5px;
302+
border-radius: 5px;
303303
box-shadow: black 5px 5px 5px 0;
304304
}
305305

306306
@media (min-width: 768px) {
307307
.upcoming__col {
308-
margin-left: 0.5%;
308+
margin-left: 5.5%;
309309
}
310310
}
311311

312-
.upcoming-title {
312+
.upcoming__title {
313313
font-size: 2.5em;
314314
color: antiquewhite;
315-
text-align: left;
315+
text-align: center;
316316
font-family: 'Encode Sans Expanded', sans-serif;
317317
margin-top: 2.5%;
318318
margin-bottom: 2.5%;
@@ -344,22 +344,39 @@ a {
344344
}
345345

346346
.upcoming__logo-col {
347+
padding-right: 0;
348+
padding-left: 0;
347349
flex: 1;
348350
}
349351

352+
@media (min-width: 768px) {
353+
.upcoming__logo-col {
354+
margin-right: 5.5%;
355+
}
356+
}
357+
358+
350359
.upcoming__project-logo {
351-
margin-top: 5%;
360+
margin: 0.5em;
352361
border: #A55605 3px double;
353362
border-radius: 5px;
354363
max-width: 50%;
355-
;
356364
}
357365

358-
@media (min-width: 768px) {
359-
.upcoming__project-logo {
360-
margin-top: 2.5%;
361-
margin-left: 2.5%;
362-
}
366+
.upcoming__sponsor-list {
367+
background: rgba(7, 41, 72, 0.7);
368+
border: #072948 2px ridge;
369+
margin-top: 1em;
370+
border-radius: 5px;
371+
box-shadow: rgba(0, 0, 0, 0.76) 5px 5px 5px 0;
372+
}
373+
374+
.upcoming__sponsor-title {
375+
color: antiquewhite;
376+
font-family: 'Encode Sans Expanded', sans-serif;
377+
font-size: 2.5em;
378+
margin-top: 2.5%;
379+
margin-bottom: 2.5%;
363380
}
364381

365382
.upcoming__button-row {
@@ -388,7 +405,7 @@ a {
388405
&:hover {
389406
color: antiquewhite;
390407
background: rgba(0, 0, 0, 0.4);
391-
border: antiquewhite 1px solid;
408+
border: #A55605 1px solid;
392409
}
393410
}
394411

@@ -602,6 +619,8 @@ a {
602619

603620
.footer__sponsor-col {
604621
text-align: center;
622+
padding-left: 0;
623+
padding-right: 0;
605624
}
606625

607626
.footer__icon {

index.html

Lines changed: 95 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ <h3 class="mission__statement">Provide mentorship and challenge for people of al
5353
<hr class="upcoming-divider">
5454
<div class="upcoming__img-container col-md-12">
5555
<div class="row">
56-
<div class="upcoming__col col-md-5 col-12">
57-
<h2 class="upcoming-title">Upcoming Event</h2>
56+
<div class="upcoming__col col-md-5 col-12 mr-auto">
57+
<h2 class="upcoming__title">Upcoming Event</h2>
5858
<div class="row">
5959
<div class="no-gutters__col col-3">
6060
<h2 class="post__label">Event</h2>
@@ -76,7 +76,6 @@ <h2 class="post__label">Venue</h2>
7676
{{ post.venue }}
7777
</div>
7878
</div>
79-
8079
<div class="row">
8180
<div class="no-gutters__col col-3">
8281
<h2 class="post__label">Date</h2>
@@ -87,11 +86,100 @@ <h2 class="post__label">Date</h2>
8786
{{ post.date | date: "%e %B %Y" }}
8887
</div>
8988
</div>
89+
{% if post.project_logo %}
90+
<div class="row">
91+
<div class="no-gutters__col col-3">
92+
<h2 class="post__label">Project</h2>
93+
</div>
94+
</div>
95+
<div class="row">
96+
<div class="upcoming__event-title col-12 text-center">
97+
<a href="{{ post.project_link }}">
98+
<img class="upcoming__project-logo" src="{{ site.baseurl }}/{{ post.project_logo }}">
99+
</a>
100+
</div>
101+
</div>
102+
{% endif %}
90103
</div>
91-
<div class="upcoming__logo-col col-auto text-center">
92-
<a href="http://pandas.pydata.org/index.html">
93-
<img class="upcoming__project-logo" src="{{ site.baseurl }}/{{ post.project_logo }}">
94-
</a>
104+
<div class="upcoming__logo-col col-md-5 text-center">
105+
<div class="upcoming__sponsor-list">
106+
<h2 class="upcoming__sponsor-title">Supported By</h2>
107+
108+
109+
{% comment %}
110+
Assume number of sponsors is even. We are going to create rows of 2 sponsors in each.
111+
If not even the last row must contain 1 sponsor and be terminated with appropriate tags.
112+
{% endcomment %}
113+
114+
{% assign sponsors = "" | split: ',' %}
115+
{% for sponsor in site.sponsors %}
116+
<!--HEre select item that maches the sponsor_id - the object
117+
instead of just the string sponsor name.-->
118+
{% assign sponsors = sponsors | push: sponsor %}
119+
{% endfor %}
120+
{% assign num_of_sponsors = sponsors | size %}
121+
{% assign sponsors_remainder = num_of_sponsors | modulo: 2 %}
122+
123+
{% if sponsors_remainder == 0 %}
124+
{% assign num_of_sponsors_even = true %}
125+
{% assign row_num_modifier = 1 %}
126+
{% else %}
127+
{% assign num_of_sponsors_even = false %}
128+
{% assign row_num_modifier = 0 %}
129+
{% endif %}
130+
131+
{% assign num_of_rows = num_of_sponsors | divided_by: 2 | floor | minus: row_num_modifier %}
132+
{% assign items_per_row = 1 %}
133+
134+
{% for row in (0..num_of_rows) %}
135+
{% if forloop.last and num_of_sponsors_even == false %}
136+
{% assign items_per_row = 0 %}
137+
{% endif %}
138+
<div class="row">
139+
{% for col in (0..items_per_row) %}
140+
{% assign sponsor_index = row | times: 2 | plus: col %}
141+
{% assign sponsor = sponsors[sponsor_index] %}
142+
<div class="footer__sponsor-col col-md-12 col-lg-6">
143+
<a class="footer__sponsor-link" href="{{ sponsor.sponsor_link }}">
144+
<img class="footer__img" src="{{ site.baseurl }}/{{ sponsor.sponsor_logo }}">
145+
</a>
146+
</div>
147+
{% endfor %}
148+
</div>
149+
{% endfor %}
150+
151+
152+
153+
154+
155+
156+
157+
158+
159+
160+
161+
162+
163+
164+
165+
166+
167+
168+
169+
170+
171+
172+
173+
174+
175+
176+
177+
178+
179+
180+
181+
182+
</div>
95183
</div>
96184
</div>
97185
<div class="upcoming__button-row row">

0 commit comments

Comments
 (0)