Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/node_modules/
.jekyll-metadata
_site
.bundle
vendor/
4 changes: 4 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines }}{% else %}{{ site.description }}{% endif %}">

<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.0.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.0.0/mapbox-gl.css' rel='stylesheet' />


<link rel="stylesheet" href="{{ "/css/main.css" }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">
Expand Down
47 changes: 44 additions & 3 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,50 @@ <h1 class="post-title">ClojureBridge {{ event.city }}</h1>
{% assign latitude=event.latitude %}
{% assign longitude=event.longitude %}
{% assign zoom=16 %}
<a href="https://www.google.com/maps/place/{{ latitude }}+{{ longitude }}/@{{ latitude }},{{ longitude }},{{ zoom }}z">
<img alt="{{ event.city }} map" src="https://maps.googleapis.com/maps/api/staticmap?size=450x300&amp;zoom={{ zoom }}&amp;markers={{ latitude }}%2C{{ longitude }}&amp;key=AIzaSyBHlZkrV89gVAL1z9Wy95LkBiS27UsAv3g">
</a>
<div id="map" class="map"></div>

<script>

mapboxgl.accessToken = 'pk.eyJ1IjoiY2xvanVyZWJyaWRnZSIsImEiOiJjanhhcWx6MjAwNjZpNDBwYjFndWl5NGkyIn0.4An4DAFMdku7GgcMfN-HPA';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/streets-v11',
center: [ {{longitude}}, {{ latitude}}],
zoom: 6
});

var geojson = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"iconSize": [60, 74]
},
"geometry": {
"type": "Point",
"coordinates": [
{{ longitude }},
{{ latitude }}
]
}
}]
};

geojson.features.forEach(function(marker) {

var el = document.createElement('div');
el.className = 'marker';
el.style.backgroundImage = 'url(/assets/images/marker.png)';
el.style.width = marker.properties.iconSize[0] + 'px';
el.style.height = marker.properties.iconSize[1] + 'px';

new mapboxgl.Marker(el)
.setLngLat(marker.geometry.coordinates)
.addTo(map);
});
</script>

{% endif %}
<h3>Location</h3>
<p>{% if event.street %}{{ event.street }}, {% endif %}{{ event.city }}, {{ event.country }}</p>
Expand Down
Binary file added assets/images/marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ body {
overflow: auto;
}

.map {
width: 100%;
height: 300px;
margin-bottom: 2em;
}

.marker {
background-size: cover;
margin-top: -37px;
}

@media screen and (min-width: 800px) {
.logo {
float: left;
Expand Down