Skip to content

Commit 9537539

Browse files
Changed yml variables in chapters to unify names in chapters and events (posts) so that they can be used in one map generating function.
Added comments to events_array_generator.html. Added call to on_load.js script in head.html. Created new include: locations_variable_generator.html to create a JSON object for use in map generation. Created chapter.html which will be the layout for chapter view (just a copy of about page atm and unused). Created on_load.js in which code that need to exist before page is loaded should be. Atm only the mapInit function is there (keep is as small as possible). Changed collections definition in _config.yml and _config_def.yml to render chapters into html. Removed code generating variable locations and map generation from index.html - it is now called through an include and the callback to mapInit uses the function defined in on_load.js.
1 parent 966db90 commit 9537539

File tree

12 files changed

+220
-85
lines changed

12 files changed

+220
-85
lines changed

_chapters/london_python_sprints.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
2-
chapter_id: london_python_sprints
3-
chapter_name: "London Python Sprints"
4-
chapter_meetup_link: https://www.meetup.com/Python-Sprints/
5-
chapter_location: London, United Kingdom
2+
layout: default
3+
id: london_python_sprints
4+
title: "London Python Sprints"
5+
meetup_link: https://www.meetup.com/Python-Sprints/
6+
address: London, United Kingdom
67
lat: 51.512344
78
lng: -0.090985
89
---

_chapters/madrid_test_sprints.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
2-
chapter_id: madrid_test_sprints
3-
chapter_name: "Madrid Test Sprints"
4-
chapter_meetup_link: https://www.meetup.com/Python-Sprints/
5-
chapter_location: Madrid, Spain
2+
layout: default
3+
id: madrid_test_sprints
4+
title: "Madrid Test Sprints"
5+
meetup_link: https://www.meetup.com/Python-Sprints/
6+
address: Madrid, Spain
67
lat: 40.416775
78
lng: -3.703790
89
---

_chapters/szczecin_test_sprints.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
2-
chapter_id: szczecin_test_sprints
3-
chapter_name: "Szczecin Test Sprints"
4-
chapter_meetup_link: https://www.meetup.com/Python-Sprints/
5-
chapter_location: Szcecin, Poland
2+
layout: default
3+
id: szczecin_test_sprints
4+
title: "Szczecin Test Sprints"
5+
meetup_link: https://www.meetup.com/Python-Sprints/
6+
address: Szczecin, Poland
67
lat: 53.428544
78
lng: 14.552812
89
---

_config.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ exclude:
2424
- DOCS/
2525
future: true
2626
collections:
27-
- sponsors
28-
- chapters
27+
sponsors:
28+
chapters:
29+
output: true
2930

3031
# command to run build locally:
3132
# bundle exec jekyll serve --config _config.yml,_config_dev.yml

_config_dev.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ exclude:
2424
- DOCS/
2525
future: true
2626
collections:
27-
- sponsors
28-
- chapters
27+
sponsors:
28+
chapters:
29+
output: true
2930

3031
# command to run build locally:
3132
# bundle exec jekyll serve --host 0.0.0.0 --config _config.yml,_config_dev.yml

_includes/event_layout.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% comment %}
2-
Please note that css will not accept an id starting with a number which is
3-
what post.id starts with (date) or containing "."
4-
I also remove "/" to make the id more readable.
2+
Please note that css will not accept an id starting with a number which is
3+
what post.id starts with (date) or containing "."
4+
I also remove "/" to make the id more readable.
55
{% endcomment %}
66

77
{% assign post_id = include.post.id | remove: "/" | remove: "." | prepend: "_" %}

_includes/events_array_generator.html

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
{% comment %}
2-
This include is to generate a list of posts for use in views.
3-
The array posts is to be used then in the view.
2+
events_array_generator.html (future_events, limit):
3+
4+
Create an array of selected posts (events) for a layout.
5+
6+
This include is to generate an array of posts (events) for use in layouts.
7+
Jekyll's standard variable site.posts contains all posts across entire site.
8+
This include is used for selecting the ones we want to display.
9+
410
Parameters:
5-
- future_events: (bool) Include future events in the array?
11+
future_events: bool, default: false
12+
Include future events in the array?
613
If future_events is true, no past events will be added.
714
If it is false, only past events are added.
8-
Default: false.
9-
- limit: (int) How many events to add to the array.
10-
Default: 0 (no limit).
11-
Creates variable for use in the outer scope:
12-
- posts (array) Array of post objects.
15+
limit: int, default: 0 (no limit)
16+
How many events to add to the array.
17+
Returns:
18+
posts: liquid array
19+
Array of post objects - variable for use in the outer scope.
1320
{% endcomment %}
1421

1522
{% if include.future_events %}

_includes/head.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta name=”description”
55
content=”Python Sprints is a non for profit group gathering coders who want to help improve open source projects using Python programming language.”>
66
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
7+
<script src="{{ site.baseurl }}/static/js/on_load.js"></script>
78
<link href="https://fonts.googleapis.com/css?family=Share+Tech+Mono" rel="stylesheet">
89
<link href="https://fonts.googleapis.com/css?family=Encode+Sans+Expanded" rel="stylesheet">
910
<link href="https://fonts.googleapis.com/css?family=Playfair+Display" rel="stylesheet">
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{% comment %}
2+
locations_variable_generator.html (locations_array):
3+
4+
Create a javascript variable for use in the function adding map markers.
5+
6+
Accepts Liquid array object and converts it to a javascript list
7+
of dictionaries.
8+
9+
Parameters:
10+
11+
locations_array: Liquid array
12+
A Liquid array containing locations to convert to javascript array
13+
of dictionaries. Can contain only 1 element.
14+
15+
Returns:
16+
locations: JSON
17+
Javascript array of dictionaries with locations' details.
18+
19+
Further info:
20+
To generate an array:
21+
{% assign chapters = "" | split: ',' %}
22+
{% for chapter in site.chapters %}
23+
{% assign chapters = chapters | push: chapter %}
24+
{% endfor %}
25+
26+
But it should be enough to use site.chapters or site.posts etc.
27+
{% endcomment %}
28+
29+
30+
31+
<script>
32+
var locations = [
33+
{% for location in include.locations_array %}
34+
{"id": "{{ location.id }}",
35+
"title": "{{ location.title }}",
36+
"meetupURL": "{{ location.meetup_link }}",
37+
"URL": "{{ location.url }}",
38+
"address": "{{ location.address }}",
39+
"lat": {{ location.lat }},
40+
"lng": {{ location.lng }}
41+
},
42+
{% endfor %}
43+
];
44+
</script>

_layouts/chapter.html

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<section class="about">
2+
<div class="about__background-img-container">
3+
<picture>
4+
<source srcset="../static/images/about/date-util-evening-session_480x150px.jpg 480w,
5+
../static/images/about/date-util-evening-session_960x300px.jpg 960w,
6+
../static/images/about/date-util-evening-session_1920x600px.jpg 1920w,
7+
../static/images/about/date-util-evening-session_3840x1200px.jpg 3840w"
8+
media="(orientation: landscape)"
9+
sizes="100vw">
10+
<source srcset="../static/images/about/date-util-evening-session_750x650px.jpg 750w,
11+
../static/images/about/date-util-evening-session_1650X1100px.jpg 1650w"
12+
media="(orientation: portrait)"
13+
sizes="100vw">
14+
<img class="about__background-img"
15+
src="../static/images/about/date-util-evening-session_960x300px.jpg"
16+
alt="About Us">
17+
</picture>
18+
<div class="about__page-title-container row container-fluid">
19+
<div class="col-sm-12">
20+
<h1 class="about__page-title">About Us</h1>
21+
<h2 class="about__page-subtitle">Our Goals, Our Story</h2>
22+
</div>
23+
</div>
24+
</div>
25+
<div class="about__container container-fluid">
26+
<div class="row">
27+
<div class="col-12 no-padding-x">
28+
<h2 class="about__section-title-left">Who We Are</h2>
29+
<div class="row">
30+
<div class="col-md-8 offset-md-2">
31+
<img class="about__paragraph-img-main rounded" src="../static/images/about/python_sprints_decoded_673x411px.JPG" alt="Focused on quality">
32+
<h2 class="about__paragraph-title-dark">Python Sprints Decoded</h2>
33+
<hr class="about__divider-right">
34+
<p class="about__paragraph-dark">
35+
Python Sprints is a non for profit group of like minded programmers who care about making open source projects better.
36+
We believe in sharing our skills for free to earn our good karma. If you are devoted to a particular open source project, please let us know, we could make a sprint dedicated to it!
37+
Inclusion is in the nature of our group and we want to make sure that no one is underrepresented. All people are welcome.
38+
</p>
39+
<h2 class="about__paragraph-title-dark-left">How It Started</h2>
40+
<hr class="about__divider-left">
41+
<p class="about__paragraph-dark">
42+
Our group was founded in October 2017. As all things in life the beginnings were humble with only a handful of people collaborating but the word quickly spread and now we have nearly 600 members and counting.
43+
</p>
44+
<h1>{{ page.title }}</h1>
45+
</div>
46+
</div>
47+
</div>
48+
</div>
49+
</div>
50+
<div class="about__img-outer-container col-md-12">
51+
<div class="about__img-top-container">
52+
<div class="about__img-top-title-container">
53+
<h2 class="about__img-top-title">Passion</h2>
54+
</div>
55+
</div>
56+
<div class="about__img-bot-container">
57+
<div class="about__img-bot-title-container">
58+
<h2 class="about__img-bot-title">Dedication</h2>
59+
</div>
60+
</div>
61+
</div>
62+
<div class="about__container container-fluid">
63+
<div class="row">
64+
<div class="col-12 no-padding-x">
65+
<h2 class="about__section-title-right">Our Way</h2>
66+
<div class="row">
67+
<div class="col-md-8 offset-md-2">
68+
<img class="about__paragraph-img-main rounded" src="../static/images/about/teamwork_673x411px.JPG" alt="Teamwork for the win">
69+
<h2 class="about__paragraph-title-dark">Teamwork Rules</h2>
70+
<hr class="about__divider-right">
71+
<p class="about__paragraph-dark">
72+
We believe in helping each other to bring the knowledge in the group up to the highest possible level. Anyone can ask a question and expect aid in their problems during the session. We have people using all kinds of OSes, editors etc. and we all sometimes struggle but a solution is just ask someone else to have a look.
73+
</p>
74+
<h2 class="about__paragraph-title-dark-left">What Our Meetings Look Like?</h2>
75+
<hr class="about__divider-left">
76+
<p class="about__paragraph-dark">
77+
Usually there is a subject advertised well ahead of the time with clear setup instructions so that everyone can come prepared.
78+
But you should not worry if setting up is difficult - part of our creed is to help new people get introduced into the world of open source.
79+
Help will be provided even if it is just creating a git repository and learning how to contribute. It is all part of growing our group organically and all people are welcome!
80+
All the coding aside there is always time for a joyful banter, sharing work and life experiences with pizza and beers to hand.
81+
</p>
82+
</div>
83+
</div>
84+
</div>
85+
</div>
86+
</div>
87+
</section>

0 commit comments

Comments
 (0)