Skip to content

Commit 6390a84

Browse files
Added image variable to chapter - now only one image is needed.
Modified chapter.html to use image stored in image variable as the hero image. Added image to description on how to add a chapter in README.md.
1 parent 09a89c9 commit 6390a84

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ separating words with underscore (e.g. `london_pyton_sprints`).
3434
The content of the file has a header section with some fields (started and finished with
3535
---), and the main description of the chapter afterwards.
3636
We are using markdown files to store your data and they can contain either markdown tags for text formatting or pure html - it is up to you how to style your content.<br>
37+
The image that will represent your chapter should be in jpeg format. The size the content is optimized for is: 1920 x 600 px.
38+
Please name it <your_chapter_name_1920x600px.jpg>.
3739
This is the format:
3840

3941
---
@@ -42,6 +44,7 @@ This is the format:
4244
meetup_link: <url-of-your-other-website-if-any>
4345
address: "Description of your location, usually City, Country"
4446
country_code: <2-digit-country-code-used-for-the-flag>
47+
image: <relative path to the chapter image>
4548
lat: <float-number-with-latitude-for-the-marker-in-the-map>
4649
lng: <float-number-with-longitude-for-the-marker-in-the-map>
4750
sponsors:
@@ -68,6 +71,7 @@ Example chapter setup
6871
meetup_link: https://www.meetup.com/Python-Sprints/
6972
address: London, United Kingdom
7073
country_code: gb
74+
image: static/images/chapters/london_python_sprints_1920x600px.jpg
7175
lat: 51.512344
7276
lng: -0.090985
7377
sponsors:

_chapters/london_python_sprints.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ title: "London Python Sprints"
44
meetup_link: https://www.meetup.com/Python-Sprints/
55
address: London, United Kingdom
66
country_code: gb
7+
image: static/images/chapters/london_python_sprints_1920x600px.jpg
78
lat: 51.512344
89
lng: -0.090985
910
sponsors:

_layouts/chapter.html

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,9 @@
66
<main>
77
<article>
88
<div class="chapter__background-img-container">
9-
<picture>
10-
<source srcset="../static/images/about/date-util-evening-session_480x150px.jpg 480w,
11-
../static/images/about/date-util-evening-session_960x300px.jpg 960w,
12-
../static/images/about/date-util-evening-session_1920x600px.jpg 1920w,
13-
../static/images/about/date-util-evening-session_3840x1200px.jpg 3840w"
14-
media="(orientation: landscape)"
15-
sizes="100vw">
16-
<source srcset="../static/images/about/date-util-evening-session_750x650px.jpg 750w,
17-
../static/images/about/date-util-evening-session_1650X1100px.jpg 1650w"
18-
media="(orientation: portrait)"
19-
sizes="100vw">
20-
<img class="chapter__background-img"
21-
src="../static/images/about/date-util-evening-session_960x300px.jpg"
22-
alt="About Us">
23-
</picture>
9+
<img class="chapter__background-img"
10+
src="{{ site.baseurl }}/{{ page.image }}"
11+
alt="{{ page.title }} photo">
2412
<div class="chapter__page-title-container row container-fluid">
2513
<div class="col-sm-12">
2614
<h1 class="chapter__page-title">{{ page.title }}</h1>

_sass/chapter.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
}
66
}
77

8+
89
.chapter__background-img {
9-
@extend .page__background-img;
10+
width: 100%;
11+
height: 60vh;
12+
object-fit: cover;
13+
object-position: 50% 50%;
1014
}
1115

1216
.chapter__page-title-container {
169 KB
Loading

0 commit comments

Comments
 (0)