Skip to content

Commit 3ffc9aa

Browse files
Making creation of events more efficient (_posts in root, using _projects collection, simper design)
1 parent e7a31d6 commit 3ffc9aa

13 files changed

+155
-118
lines changed

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
======================
2+
Python sprints website
3+
======================
4+
5+
This is the website of the Python sprints group.
6+
7+
It was started by the London Python Sprints meetup, but open to any other
8+
Python User Group (PUG), interested in running sprints.
9+
10+
Website set up
11+
--------------
12+
13+
The website is built using Jekyll, a Ruby (yes, Ruby ;) static website
14+
generator supported by GitHub pages. To build the website locally you
15+
need to:
16+
17+
- Install ruby and ruby-dev
18+
- `dnf install ruby ruby-devel` on Fedora, CentOS and RedHat
19+
- `apt-get install ruby-full ruby-dev` on Debian and Ubuntu
20+
- `brew install ruby` on MacOS
21+
- More information about installing Ruby is here
22+
<https://www.ruby-lang.org/en/documentation/installation/>.
23+
- Install Jekyll with `gem install jekyll bundle`.
24+
- Install dependencies with `bundle install` in the project directory.
25+
- Run the server with `bundle exec jekyll serve`.
26+
- Open the rendered website at http://localhost:4000/
27+
28+
How to add your chapter
29+
-----------------------
30+
31+
Send a pull request adding a new file `_chapters/<your-chapter-name>.md`, where
32+
`<your-chapter-name>` is the name of your chapter in ascii lowercase, and
33+
separating words with underscore (e.g. `london_pyton_sprints`).
34+
35+
The content of the file should list:
36+
- layout: default
37+
- object_id: same as the name of the file, as described before (without the extension)
38+
- title: name of your chapter (using normal text)
39+
- website_link: link to your website
40+
- address: name of the city, country... or anything relevant so users understand where
41+
you are based
42+
- lnt and lng: latitude and longitude used to display a marker for your chapter in
43+
a map
44+
45+
How does Jekyll work?
46+
---------------------
47+
48+
#### Create layouts (templates for django people) to generate your views
49+
#### Create content files with yml variables(date) and html / plain text to feed into the layouts
50+
#### Use scss (sass) or less to style (automatically preprocessed into css during build) - see _sass (partials)
51+
#### Main content goes into _pages
52+
#### Use Liquid templating language (similar to jinja2 / django templating languages) to create logic
53+
#### includes are your friends - use them as modules, functions , snippets of html or whatever
54+
#### time related files - _posts (see chapters_events), categories are automatically generated by jekyll using the parent folder name as the category name
55+
#### subject related files - collections, have to add them in _config.yml for jekyll to see them properly (see _sponsors, _chapters)
56+
#### Config in _config.yml
57+
#### Static content - images, javascript, css in static folder.
58+
59+
#### When change pushed to master / origin - github pages rebuilds the site.

_config.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# Site settings
21
title: Python-Sprints
3-
# email: your-email@domain.com
2+
email: py.sprints@gmail.com
43
description: > # this means to ignore newlines until "baseurl:"
5-
Python-Sprints is a non profit organisation gathering Python programmers and helping improve code in open source projects.
4+
Python Sprints is a website to promote sprints in the Python community
65
baseurl: "" # the subpath of your site, e.g. /blog/
76
url: "https://python-sprints.github.io/" # the base hostname & protocol for your site
8-
# twitter_username: jekyllrb
7+
twitter_username: py_sprints
98
github_username: python-sprints
109

1110
# Build settings
@@ -15,7 +14,6 @@ sass:
1514
kramdown:
1615
input: GFM
1716
include: ["_test.html", "_static", "pandas/guide/_static", "_pages"]
18-
#include: ["_pages"]
1917
exclude:
2018
- Gemfile
2119
- Gemfile.lock
@@ -29,6 +27,8 @@ collections:
2927
output: false
3028
chapters:
3129
output: true
30+
projects:
31+
output: false
3232

3333
defaults:
3434
-
@@ -53,4 +53,4 @@ defaults:
5353
layout: "default"
5454

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

_layouts/post.html

Lines changed: 49 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,128 +1,67 @@
11
<!DOCTYPE html>
2-
<html lang="en">
32
{% include head.html %}
43
{% if page.image %}
54
{% assign image = page.image %}
65
{% else %}
76
{% assign image = "static/images/events/default_image_800x800px.jpeg" %}
87
{% endif %}
98
{% include get_host_sponsor.html event = page %}
10-
<style>
11-
.post__img-container {
12-
background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("{{ site.baseurl }}/{{ image }}");
13-
}
9+
{% for item in site.projects %}
10+
{% if item.obj_id == page.project %}
11+
{% assign project = item %}
12+
{% endif %}
13+
{% endfor %}
14+
{% for item in site.sponsors %}
15+
{% if item.obj_id == page.sponsor %}
16+
{% assign sponsor = item %}
17+
{% endif %}
18+
{% endfor %}
19+
<html lang="en">
20+
<head>
21+
<style>
22+
.post__img-container {
23+
background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url("{{ site.baseurl }}/{{ image }}");
24+
}
1425

15-
@media (min-width: 769px) {
16-
.post__img-container {
17-
background-image: linear-gradient(75deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6) 80%, rgba(0, 0, 0, 0.6) 80%, black 87%, black 100%), url("{{ site.baseurl }}/{{ image }}");
18-
}
19-
}
20-
</style>
21-
<body class="body">
22-
{% include navigation.html %}
26+
@media (min-width: 769px) {
27+
.post__img-container {
28+
background-image: linear-gradient(75deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6) 80%, rgba(0, 0, 0, 0.6) 80%, black 87%, black 100%), url("{{ site.baseurl }}/{{ image }}");
29+
}
30+
}
31+
</style>
32+
</head>
33+
<body>
2334
<main>
2435
<article class="post">
25-
<div class="row">
26-
<div class="no-gutters__col col-md-12 container-fluid">
27-
<div class="row">
28-
<div class="post__img-container col-md-7 col-sm-12">
29-
<!--<h1 class="post__title">{{ page.project }}</h1>-->
30-
<h1 class="post__title">{{ page.title }}</h1>
31-
<!--<h2 class="post__subtitle"><em>{{ page.project_description }}</em></h2>-->
32-
<h2 class="post__subtitle">{{ page.subtitle }}</h2>
33-
</div>
34-
<div class="post__event-col col-md-5 col-12">
35-
<div class="row">
36-
<div class="no-gutters__col col-6">
37-
<!--<h2 class="post__label">Event</h2>-->
38-
<h2 class="post__label">Project</h2>
39-
</div>
40-
</div>
41-
<div class="row">
42-
<div class="post__event-title col-12">
43-
{{ page.project }}
44-
</div>
45-
</div>
46-
47-
<div class="row">
48-
<div class="no-gutters__col col-6">
49-
<h2 class="post__label">Venue</h2>
50-
</div>
51-
</div>
52-
<div class="row">
53-
<div class="post__event-title col-12">
54-
{{ host_sponsor.name }}
55-
</div>
56-
</div>
57-
58-
<div class="row">
59-
<div class="no-gutters__col col-6">
60-
<h2 class="post__label">Date</h2>
61-
</div>
62-
</div>
63-
<div class="row">
64-
<div class="post__event-title col-12">
65-
{{ page.date | date: "%e %B %Y" }}
66-
</div>
67-
</div>
68-
69-
<div class="row">
70-
<div class="post__button-col col-12 no-padding-x">
71-
<div class="row">
72-
{% if page.event_link %}
73-
{% assign meetup_col_class = "col-lg-6" %}
74-
{% assign meetup_button_class = "post__button" %}
75-
{% else %}
76-
{% assign meetup_col_class = "col-12" %}
77-
{% assign meetup_button_class = "post__button-solo" %}
78-
{% endif %}
79-
<div class="{{ meetup_col_class }} text-center">
80-
<a class="{{ meetup_button_class }} btn btn-primary btn-lg text-center" href="{{ page.meetup_link }}">
81-
<i class="post__icon fab fa-meetup"></i>
82-
</a>
83-
</div>
84-
{% if page.event_link %}
85-
<div class="col-lg-6 text-center">
86-
<a class="post__button btn btn-primary btn-lg text-center" href="{{ page.event_link }}">
87-
<i class="post__icon fas fa-external-link-square-alt"></i>
88-
</a>
89-
</div>
90-
{% endif %}
91-
</div>
92-
</div>
93-
</div>
94-
</div>
95-
</div>
96-
</div>
97-
</div>
9836
<div class="container-fluid">
9937
<div class="row">
100-
<div class="post__content col-md-12">
101-
38+
<div class="post__content col-md-8">
39+
<img src="{{ project.logo }}">
10240
<h1 class="post__content-title">{{ page.title }}</h1>
41+
<p>Level: {{ page.level }}</p>
42+
<p class="post__paragraph">{{ project.content }}</p>
43+
<p class="post_paragraph">More information about {{ project.name }}: <a href="{{ project.website }}">{{ project.website }}</a></p>
10344
<p class="post__paragraph">{{ page.content }}</p>
104-
<hr class="post__divider">
105-
<h1 class="post__content-title">When & Where</h1>
45+
<h3>Set up instructions</h3>
46+
{{ project.setup_html }}
47+
</div>
48+
<div class="post__content col-md-4">
49+
<h1 class="post__content-title">Info</h1>
10650
<p class="post__address-title">{{ page.date | date: "%e %B %Y" }}, {{ page.time }}</p>
107-
<p class="post__address-title">{{ host_sponsor.name }}</p>
108-
<p class="post__address">{{ host_sponsor.address }}</p>
109-
<div class="chapters__content row">
110-
<div class="col-12 my-auto">
111-
<div id="chapters__map"></div>
112-
{% comment %}
113-
Create a javascript variable for use in the function adding map markers.
114-
{% endcomment %}
115-
{% assign locations = "" | split: ',' %}
116-
{% assign location = page %}
117-
{% assign locations = locations | push: location %}
118-
{% include locations_variable_generator.html locations_array = locations %}
119-
<script async defer
120-
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB0NCzoIqGkYFdpRl-LmgWTKpxPBkqxxO0&callback=initMap">
121-
</script>
122-
</div>
123-
</div>
124-
<hr class="post__divider">
125-
<h1 class="post__content-title">Event's sponsors</h1>
51+
<img class="post__sponsor-img" src="{{ sponsor.logo }}">
52+
<p class="post__address-title">{{ sponsor.name }}</p>
53+
<p class="post__address">{{ sponsor.address }}</p>
54+
<div id="chapters__map"></div>
55+
{% comment %}
56+
Create a javascript variable for use in the function adding map markers.
57+
{% endcomment %}
58+
{% assign locations = "" | split: ',' %}
59+
{% assign location = page %}
60+
{% assign locations = locations | push: location %}
61+
{% include locations_variable_generator.html locations_array = locations %}
62+
<script async defer
63+
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB0NCzoIqGkYFdpRl-LmgWTKpxPBkqxxO0&callback=initMap">
64+
</script>
12665
</div>
12766
</div>
12867
{% for sponsor in page.sponsors %}
@@ -151,4 +90,4 @@ <h3 class="post__sponsor-name">{{ sponsor_obj.name }}</h3>
15190
</main>
15291
{% include scripts.html %}
15392
</body>
154-
</html>
93+
</html>

chapters_events/london_python_sprints/_posts/2017-10-04-Bokeh-As-A-Backend-For-Pandas.md renamed to _posts/2017-10-04-Bokeh-As-A-Backend-For-Pandas.md

File renamed without changes.

chapters_events/london_python_sprints/_posts/2017-10-24-PyMC3.md renamed to _posts/2017-10-24-PyMC3.md

File renamed without changes.

chapters_events/london_python_sprints/_posts/2017-11-01-www.python.org-Part1.md renamed to _posts/2017-11-01-www.python.org-Part1.md

File renamed without changes.

chapters_events/london_python_sprints/_posts/2017-12-06-python-dateutil.md renamed to _posts/2017-12-06-python-dateutil.md

File renamed without changes.

chapters_events/london_python_sprints/_posts/2018-03-10-Pandas-Documentation-Sprint.md renamed to _posts/2018-03-10-Pandas-Documentation-Sprint.md

File renamed without changes.

chapters_events/london_python_sprints/_posts/2018-03-20-Pandas-Beginners-Friendly.md renamed to _posts/2018-03-20-Pandas-Beginners-Friendly.md

File renamed without changes.

chapters_events/london_python_sprints/_posts/2018-03-22-pandasSprint continued (ALL LEVELS).md renamed to _posts/2018-03-22-pandasSprint continued (ALL LEVELS).md

File renamed without changes.

0 commit comments

Comments
 (0)