Skip to content

Commit c3b4e79

Browse files
Created initial version of chapter content for London Python Sprint.
The chapter's content is left to the groups imagination and I do not want to set any standard, strict look. The only limit is at the top there should be an image in sizes as for the London Group. Added new parameter to the events_array _generator.html - category which allows easily select set of posts also based on category (to which chapter it belongs). Fixed navigation to not show not available options for chapter. Created basic chapter.html layout (to be worked on futher). Added 2 test events for fictional Madrid chapter to see if events_array_generator works well with categories set - all ok. Added chapter.scss - style for the chapter.html layout. Imported chapter.scss in main.scss Set default layout for chapter to chapter in _config.yml and _config_dev.yml.
1 parent 9e17c4b commit c3b4e79

File tree

11 files changed

+330
-94
lines changed

11 files changed

+330
-94
lines changed

_chapters/london_python_sprints.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
layout: default
32
obj_id: london_python_sprints
43
title: "London Python Sprints"
54
meetup_link: https://www.meetup.com/Python-Sprints/
@@ -8,3 +7,49 @@ country_code: gb
87
lat: 51.512344
98
lng: -0.090985
109
---
10+
<div class="chapter__background-img-container">
11+
<picture>
12+
<source srcset="../static/images/about/date-util-evening-session_480x150px.jpg 480w,
13+
../static/images/about/date-util-evening-session_960x300px.jpg 960w,
14+
../static/images/about/date-util-evening-session_1920x600px.jpg 1920w,
15+
../static/images/about/date-util-evening-session_3840x1200px.jpg 3840w"
16+
media="(orientation: landscape)"
17+
sizes="100vw">
18+
<source srcset="../static/images/about/date-util-evening-session_750x650px.jpg 750w,
19+
../static/images/about/date-util-evening-session_1650X1100px.jpg 1650w"
20+
media="(orientation: portrait)"
21+
sizes="100vw">
22+
<img class="chapter__background-img"
23+
src="../static/images/about/date-util-evening-session_960x300px.jpg"
24+
alt="About Us">
25+
</picture>
26+
<div class="chapter__page-title-container row container-fluid">
27+
<div class="col-sm-12">
28+
<h1 class="chapter__page-title">{{ page.title }}</h1>
29+
</div>
30+
</div>
31+
</div>
32+
<div class="chapter__container container-fluid">
33+
<div class="row">
34+
<div class="col-12 no-padding-x">
35+
<h2 class="chapter__section-title-left">Who We Are</h2>
36+
<div class="row">
37+
<div class="col-md-8 offset-md-2">
38+
<img class="chapter__paragraph-img-main rounded" src="../static/images/about/python_sprints_decoded_673x411px.JPG" alt="Focused on quality">
39+
<h2 class="chapter__paragraph-title-dark">Python Sprints Decoded</h2>
40+
<hr class="chapter__divider-right">
41+
<p class="chapter__paragraph-dark">
42+
Python Sprints is a non for profit group of like minded programmers who care chapter making open source projects better.
43+
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!
44+
Inclusion is in the nature of our group and we want to make sure that no one is underrepresented. All people are welcome.
45+
</p>
46+
<h2 class="chapter__paragraph-title-dark-left">How It Started</h2>
47+
<hr class="chapter__divider-left">
48+
<p class="chapter__paragraph-dark">
49+
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.
50+
</p>
51+
</div>
52+
</div>
53+
</div>
54+
</div>
55+
</div>

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ defaults:
4444
path: ""
4545
type: "chapters"
4646
values:
47+
layout: "chapter"
4748
is_chapter: true
4849
-
4950
scope:

_config_dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ defaults:
4444
path: ""
4545
type: "chapters"
4646
values:
47+
layout: "chapter"
4748
is_chapter: true
4849
-
4950
scope:

_includes/events_array_generator.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% comment %}
2-
events_array_generator.html (future_events, limit):
2+
events_array_generator.html (future_events, limit, category):
33

44
Create an array of selected posts (events) for a layout.
55

@@ -13,10 +13,14 @@
1313
If future_events is true, no past events will be added.
1414
If it is false, only past events are added.
1515
limit: int, default: 0 (no limit)
16-
How many events to add to the array.
16+
How many events to add to the
17+
category: str, optional
18+
Event's category set in yml section. If not given all categories
19+
will be used.
1720
Returns:
1821
posts: liquid array
19-
Array of post objects - variable for use in the outer scope.
22+
Array of post objects (all or from the category)
23+
- variable for use in the outer scope.
2024
{% endcomment %}
2125

2226
{% if include.future_events %}
@@ -27,11 +31,22 @@
2731
{% if include.limit %}
2832
{% assign limit = include.limit %}
2933
{% endif %}
34+
{% if include.category %}
35+
{% assign category = include.category %}
36+
{% else %}
37+
{% assign category = all %}
38+
{% endif %}
3039

3140
{% assign post_count = 0 %}
3241
{% assign curDate = site.time | date: "%s" %}
3342
{% assign posts = "" | split: ',' %}
3443
{% for post in site.posts %}
44+
{% unless category == all %}
45+
{% unless post.category == category %}
46+
{% continue %}
47+
{% endunless %}
48+
{% endunless %}
49+
3550
{% assign postStartDate = post.date | date: "%s" %}
3651
{% if future_events %}
3752
{% if postStartDate >= curDate %}

_includes/navigation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</button>
5252
<div class="collapse navbar-collapse" id="navbarToggler">
5353
<ul class="navbar-nav ml-auto mt-2 mt-lg-0">
54-
{% unless page.is_post %}
54+
{% unless page.is_post or page.is_chapter %}
5555
<li class="nav-item active">
5656
<a class="navigation__link active nav-link" href="#home">Home<span class="sr-only">(current)</span></a>
5757
</li>

_layouts/chapter.html

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +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>
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
{% include head.html %}
4+
<body class="body">
5+
{% include navigation.html %}
6+
<main>
7+
<article>
8+
{{ content }}
9+
<div class="chapter-container container-fluid">
10+
<div class="row">
11+
{% include events_array_generator.html future_events = true %}
12+
{% if posts.size > 0 %}
13+
{% assign upcoming_event = true %}
14+
{% assign chapters_col = "col-lg-6" %}
15+
{% assign posts = posts | reverse %}
16+
{% else %}
17+
{% assign chapters_col = "col-12" %}
18+
{% endif %}
19+
{% if upcoming_event == true %}
20+
<div class="col-12 no-padding-x">
21+
<!--Upcoming Events section-->
22+
<section class="chapter">
23+
<div class="row container-fluid">
24+
<div class="col-md-12 no-padding-x">
25+
<h2 class="upcoming__title">Events</h2>
26+
</div>
27+
</div>
28+
<div class="upcoming__content row">
29+
{% assign current_date = "" %}
30+
{% for post in posts %}
31+
{% include get_host_sponsor.html event = post %}
32+
<div class="upcoming__col col-md-12 no-padding-x">
33+
<div class="row">
34+
<div class="col-12">
35+
{% unless post.date == current_date %}
36+
<p class="upcoming__date">
37+
<i class="upcoming__icon far fa-calendar-alt"></i>{{ post.date | date: "%e %B %Y" }}, {{ post.time }}
38+
</p>
39+
{% endunless %}
40+
{% assign current_date = post.date %}
41+
{% include get_project.html event = post %}
42+
<img class="upcoming__project-logo" src="{{ site.baseurl }}/{{ project.logo }}" alt="Project logo">
43+
<h2 class="upcoming__event-title"> {{ post.title }}</h2>
44+
</div>
45+
</div>
46+
<div class="row">
47+
<div class="col-12">
48+
{% if post.level %}
49+
<h2 class="upcoming__event-subtitle">Level: {{ post.level }}</h2>
50+
{% endif %}
51+
</div>
52+
</div>
53+
<div class="row">
54+
<div class="col-12">
55+
<div class="row">
56+
<div class="col-6 no-padding-x">
57+
<div class="col-12 no-padding-x">
58+
<p class="upcoming__paragraph">
59+
<i class="upcoming__icon fas fa-map-marker-alt"></i>{{ sponsor.address }}
60+
</p>
61+
</div>
62+
</div>
63+
<div class="col-6 no-padding-x text-right my-auto">
64+
<a class="upcoming__button btn" href="{{ post.url }}">
65+
<i class="upcoming__button-icon fas fa-info-circle"></i>
66+
</a>
67+
</div>
68+
</div>
69+
{% unless forloop.last %}
70+
<hr class="upcoming__divider">
71+
{% endunless %}
72+
</div>
73+
</div>
74+
</div>
75+
{% endfor %}
76+
</div>
77+
</section>
78+
</div>
79+
{% endif %}
4580
</div>
4681
</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>
82+
</article>
83+
{% include footer.html %}
84+
</main>
85+
{% include scripts.html %}
86+
</body>
87+
</html>

_posts/2018-05-22-test-3.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
category: madrid
3+
title: Event from Madrid chapter test
4+
level: All
5+
date: 2018-05-22
6+
time: "18:30"
7+
meetup_link: https://www.meetup.com/Python-Sprints/events/248712103/
8+
event_link:
9+
project: pandas
10+
image:
11+
sponsor: quantum_black
12+
---
13+
This will be a follow up of the worldwide #pandasSprint: [https://python-sprints.github.io/pandas/](https://python-sprints.github.io/pandas/)
14+
15+
Beginners to contributing to open source will get a pandas documentation page assigned, and will be guided through the step to make it as good as pandas itself. During the sprint, this step-by-step checklist will help you make your first contribution, and our senior members will help you with any problem.
16+
17+
[https://python-sprints.github.io/pandas/dashboard.html](https://python-sprints.github.io/pandas/dashboard.html)
18+
19+
Advanced contributors will be able to:
20+
- Help reviewing open pull requests
21+
- Experiment with the Sphinx theme of the pandas documentation
22+
- Improve the validation of docstrings
23+
- Refactor the contributing documentation
24+
- And of course mentor more junior contributors
25+
26+
Before the sprint, and to optimise your time, we recommend trying to set up a pandas development environment in your laptop:
27+
28+
[https://python-sprints.github.io/pandas/guide/pandas_setup.html](https://python-sprints.github.io/pandas/guide/pandas_setup.html)
29+
30+
For this sprint, we welcome our new sponsor QuantumBlack.

_posts/2018-05-22-test-4.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
category: madrid
3+
title: Event from Madrid chapter test 1
4+
level: All
5+
date: 2018-05-22
6+
time: "18:30"
7+
meetup_link: https://www.meetup.com/Python-Sprints/events/248712103/
8+
event_link:
9+
project: pandas
10+
image:
11+
sponsor: quantum_black
12+
---
13+
This will be a follow up of the worldwide #pandasSprint: [https://python-sprints.github.io/pandas/](https://python-sprints.github.io/pandas/)
14+
15+
Beginners to contributing to open source will get a pandas documentation page assigned, and will be guided through the step to make it as good as pandas itself. During the sprint, this step-by-step checklist will help you make your first contribution, and our senior members will help you with any problem.
16+
17+
[https://python-sprints.github.io/pandas/dashboard.html](https://python-sprints.github.io/pandas/dashboard.html)
18+
19+
Advanced contributors will be able to:
20+
- Help reviewing open pull requests
21+
- Experiment with the Sphinx theme of the pandas documentation
22+
- Improve the validation of docstrings
23+
- Refactor the contributing documentation
24+
- And of course mentor more junior contributors
25+
26+
Before the sprint, and to optimise your time, we recommend trying to set up a pandas development environment in your laptop:
27+
28+
[https://python-sprints.github.io/pandas/guide/pandas_setup.html](https://python-sprints.github.io/pandas/guide/pandas_setup.html)
29+
30+
For this sprint, we welcome our new sponsor QuantumBlack.

0 commit comments

Comments
 (0)