Skip to content

Commit f7354c8

Browse files
Changed post_id in event_layout.html to use slugify filter (had issues with post titles containing spaces and ( ).
Continued to adapt locations_variable_generator to be useful for chapters and events - removed "id" as it is not needed for anything. Added map to the post layout to show location of the event (unfinished). Removed layout variable from all pages (set default in _config.yml, same has to be done for all posts). Added code in on_load.js for mapInit function which centers the map on one marker if only one is available (as it is the case for event). Set collections outputs in _config.yml / _config_dev.yml. Set defaults for posts and pages in _config.yml / _config_dev.yml.
1 parent 9537539 commit f7354c8

File tree

12 files changed

+82
-38
lines changed

12 files changed

+82
-38
lines changed

_config.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,27 @@ exclude:
2323
- _pages/02_get_started.html
2424
- DOCS/
2525
future: true
26+
2627
collections:
2728
sponsors:
29+
output: false
2830
chapters:
29-
output: true
31+
output: true
32+
33+
defaults:
34+
-
35+
scope:
36+
path: ""
37+
type: "posts"
38+
values:
39+
layout: "post"
40+
is_post: true
41+
-
42+
scope:
43+
path: ""
44+
type: "pages"
45+
values:
46+
layout: "default"
3047

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

_config_dev.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,27 @@ exclude:
2323
- _pages/02_get_started.html
2424
- DOCS/
2525
future: true
26+
2627
collections:
2728
sponsors:
29+
output: false
2830
chapters:
29-
output: true
31+
output: true
32+
33+
defaults:
34+
-
35+
scope:
36+
path: ""
37+
type: "posts"
38+
values:
39+
layout: "post"
40+
is_post: true
41+
-
42+
scope:
43+
path: ""
44+
type: "pages"
45+
values:
46+
layout: "default"
3047

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

_includes/event_layout.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
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+
To create a unique html element's id we have to slugify the jekyll's post.id.
3+
Then this unique id is used to set a post dependent background image on it.
54
{% endcomment %}
65

7-
{% assign post_id = include.post.id | remove: "/" | remove: "." | prepend: "_" %}
6+
{% assign post_id = include.post.id | slugify | prepend: "_" %}
87
{% assign post_id_selector = post_id | prepend: "#" %}
98
{% if include.post.image %}
109
{% assign image = include.post.image %}

_includes/locations_variable_generator.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@
3131
<script>
3232
var locations = [
3333
{% for location in include.locations_array %}
34-
{"id": "{{ location.id }}",
35-
"title": "{{ location.title }}",
34+
{"title": "{{ location.title }}",
3635
"meetupURL": "{{ location.meetup_link }}",
3736
"URL": "{{ location.url }}",
38-
"address": "{{ location.address }}",
37+
{% if location.address %}
38+
"address": "{{ location.address }}",
39+
{% else %}
40+
{% assign sponsor = location.sponsors %}
41+
"address": "{{ sponsor.address }}",
42+
{% endif %}
3943
"lat": {{ location.lat }},
4044
"lng": {{ location.lng }}
4145
},

_layouts/post.html

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -87,38 +87,40 @@ <h2 class="post__label">Date</h2>
8787
</div>
8888
</div>
8989
</div>
90-
91-
92-
93-
<!--<div class="row">-->
94-
<!--<div class="post__button-col col-12">-->
95-
<!--<a class="post__button btn btn-primary btn-lg text-center" href="{{ page.meetup_link }}">-->
96-
<!--<i class="post__icon fab fa-meetup"></i>-->
97-
<!--</a>-->
98-
<!--{% if page.event_link %}-->
99-
<!--<a class="post__button btn btn-primary btn-lg text-center" href="{{ page.event_link }}">-->
100-
<!--<i class="post__icon fas fa-external-link-square-alt"></i>-->
101-
<!--</a>-->
102-
<!--{% endif %}-->
103-
<!--</div>-->
104-
<!--</div>-->
105-
106-
107-
108-
109-
110-
111-
11290
</div>
11391
</div>
11492
</div>
11593
</div>
11694
<div class="container-fluid">
11795
<div class="row">
11896
<div class="post__content col-md-12">
97+
11998
<h1 class="post__content-title">{{ page.title }}</h1>
12099
<p class="post__paragraph">{{ page.content }}</p>
121100
<hr class="post__divider">
101+
<h1 class="post__content-title">Event's location</h1>
102+
<div class="chapters__content row">
103+
<div class="col-12 my-auto">
104+
<div id="chapters__map"></div>
105+
{% comment %}
106+
Create a javascript variable for use in the function adding map markers.
107+
{% endcomment %}
108+
{% assign locations_test = "" | split: ',' %}
109+
{% assign first_location = site.chapters | first %}
110+
{% assign locations_test = locations_test | push: first_location %}
111+
112+
{% comment %}
113+
{% assign last_location = site.chapters | last %}
114+
{% assign locations_test = locations_test | push: last_location %}
115+
{% endcomment %}
116+
117+
{% include locations_variable_generator.html locations_array = locations_test %}
118+
<script async defer
119+
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB0NCzoIqGkYFdpRl-LmgWTKpxPBkqxxO0&callback=initMap">
120+
</script>
121+
</div>
122+
</div>
123+
<hr class="post__divider">
122124
<h1 class="post__content-title">Event's sponsors</h1>
123125
</div>
124126
</div>

_pages/01_about.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
layout: default
32
title: About
43
permalink: /about/
54
---

_pages/02_get_started.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
layout: default
32
title: Get Started
43
permalink: /get-started/
54
---

_pages/03_events.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
layout: default
32
title: Events
43
permalink: /events/
54
---

_pages/04_contact.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
layout: default
32
title: Contact
43
permalink: /contact/
54
---

_sass/post.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@
8585
padding-right: 10%;
8686
}
8787

88+
#chapters__map_test {
89+
@extend #chapters__map;
90+
}
91+
8892
.post__content-title {
8993
@extend .title-dark;
9094
margin-top: 5%;

0 commit comments

Comments
 (0)