Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explorer map to website #401

Merged
merged 7 commits into from
Oct 3, 2024
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: 0 additions & 2 deletions .github/workflows/build-staging-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: 📂 Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: 💎 setup ruby
uses: ruby/setup-ruby@v1
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "running-challenges-data"]
path = running-challenges-data
url = https://github.com/fraz3alpha/running-challenges-data.git
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ alphabet), 'Tourist' (running 20 or more different parkruns), and many more.
The `/website` folder containers a Jekyll-based website. You can build and serve the website
locally for testing by running a bash script (Linux and Mac only).

1. Download the git submodule which contains additional Running Challenges data (the build fails without this). From the root of the project:

`cd running-challenges-data`

`git submodule update --init --recursive`

`cd ..`
1. From the root of the project, run the bash script:

`./build/website/build-local-and-run.sh`
Expand Down
15 changes: 8 additions & 7 deletions build/website/build-local-and-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source build/tools.sh
JEKYLL_PORT=${JEKYLL_PORT:-4000}

# Use this to make a file that won't be cached if we changed the contents.
RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD`
# RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD`

# Enable exit on failure
set -e
Expand All @@ -35,6 +35,7 @@ echo "Copying third party Javascript libraries into the assets directory"
# Copy the required third party libraries from the top level shared project dir
mkdir -p website/assets/js/lib/third-party/
cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/
cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/
Expand All @@ -50,14 +51,14 @@ cp -r css/third-party/leaflet-extramarkers website/assets/css/third-party/
cp -r css/third-party/leaflet-fullscreen website/assets/css/third-party/
cp -r css/third-party/leaflet-markercluster website/assets/css/third-party/

echo "Copying data to website"
mkdir -p website/assets/js/lib/data
export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}"
export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}"
# echo "Copying data to website"
# mkdir -p website/assets/js/lib/data
# export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}"
# export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}"

# Replace the placeholders in the map includes, there is probably a better way to do this
${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# ${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# ${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# based on https://jekyllrb.com/docs/continuous-integration/travis-ci/

# Move into the website directory
Expand Down
15 changes: 8 additions & 7 deletions build/website/build-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source build/tools.sh
# This script pushing the built copy of the this site to a staging repository

# Use this to make a file that won't be cached if we changed the contents.
RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD`
# RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD`

# Enable exit on failure
set -e
Expand All @@ -33,6 +33,7 @@ echo "Copying third party Javascript libraries into the assets directory"
# Copy the required third party libraries from the top level shared project dir
mkdir -p website/assets/js/lib/third-party/
cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/
cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/
Expand All @@ -48,14 +49,14 @@ cp -r css/third-party/leaflet-extramarkers website/assets/css/third-party/
cp -r css/third-party/leaflet-fullscreen website/assets/css/third-party/
cp -r css/third-party/leaflet-markercluster website/assets/css/third-party/

echo "Copying data to website"
mkdir -p website/assets/js/lib/data
export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}"
export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}"
# echo "Copying data to website"
# mkdir -p website/assets/js/lib/data
# export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}"
# export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}"

# Replace the placeholders in the map includes, there is probably a better way to do this
${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# ${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# ${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# based on https://jekyllrb.com/docs/continuous-integration/travis-ci/

# Move into the website directory
Expand Down
15 changes: 8 additions & 7 deletions build/website/build-staging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source build/tools.sh
# This script pushing the built copy of the this site to a staging repository

# Use this to make a file that won't be cached if we changed the contents.
RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD`
# RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD`

# Enable exit on failure
set -e
Expand All @@ -33,6 +33,7 @@ echo "Copying third party Javascript libraries into the assets directory"
# Copy the required third party libraries from the top level shared project dir
mkdir -p website/assets/js/lib/third-party/
cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/
cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/
Expand All @@ -48,14 +49,14 @@ cp -r css/third-party/leaflet-extramarkers website/assets/css/third-party/
cp -r css/third-party/leaflet-fullscreen website/assets/css/third-party/
cp -r css/third-party/leaflet-markercluster website/assets/css/third-party/

echo "Copying data to website"
mkdir -p website/assets/js/lib/data
export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}"
export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}"
# echo "Copying data to website"
# mkdir -p website/assets/js/lib/data
# export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}"
# export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}"

# Replace the placeholders in the map includes, there is probably a better way to do this
${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# ${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# ${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# based on https://jekyllrb.com/docs/continuous-integration/travis-ci/

# Move into the website directory
Expand Down
15 changes: 8 additions & 7 deletions build/website/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ source build/tools.sh
# This script pushing the built copy of the this site to a staging repository

# Use this to make a file that won't be cached if we changed the contents.
RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD`
# RUNNING_CHALLENGES_DATA_COMMIT=`cd running-challenges-data && git rev-parse HEAD`

# Enable exit on failure
set -e
Expand All @@ -33,6 +33,7 @@ echo "Copying third party Javascript libraries into the assets directory"
# Copy the required third party libraries from the top level shared project dir
mkdir -p website/assets/js/lib/third-party/
cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/
cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/
Expand All @@ -48,14 +49,14 @@ cp -r css/third-party/leaflet-extramarkers website/assets/css/third-party/
cp -r css/third-party/leaflet-fullscreen website/assets/css/third-party/
cp -r css/third-party/leaflet-markercluster website/assets/css/third-party/

echo "Copying data to website"
mkdir -p website/assets/js/lib/data
export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}"
export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}"
# echo "Copying data to website"
# mkdir -p website/assets/js/lib/data
# export DATA_GEO_JS="website/assets/js/lib/data/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_geo = " > "${DATA_GEO_JS}" && cat running-challenges-data/data/parkrun-geo/parsed/geo.json >> "${DATA_GEO_JS}"
# export DATA_SPECIAL_EVENTS_JS="website/assets/js/lib/data/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js" && echo "var parkrun_data_special_events = " > "${DATA_SPECIAL_EVENTS_JS}" && cat running-challenges-data/data/parkrun-special-events/2019-20/parsed/all.json >> "${DATA_SPECIAL_EVENTS_JS}"

# Replace the placeholders in the map includes, there is probably a better way to do this
${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# ${SED} -i "s/data\/geo-.*.js/data\/geo-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# ${SED} -i "s/data\/special-events-.*.js/data\/special-events-${RUNNING_CHALLENGES_DATA_COMMIT}.js/" website/_pages/map.md
# based on https://jekyllrb.com/docs/continuous-integration/travis-ci/

# Move into the website directory
Expand Down
1 change: 1 addition & 0 deletions build/website/copy-assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ echo "Copying third party Javascript libraries into the assets directory"
# Copy the required third party libraries from the top level shared project dir
mkdir -p website/assets/js/lib/third-party/
cp -r js/lib/third-party/jquery website/assets/js/lib/third-party/
cp -r js/lib/third-party/d3-voronoi website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-canvasicon website/assets/js/lib/third-party/
cp -r js/lib/third-party/leaflet-extramarkers website/assets/js/lib/third-party/
Expand Down
1 change: 0 additions & 1 deletion running-challenges-data
Submodule running-challenges-data deleted from 90b9b9
29 changes: 5 additions & 24 deletions website/_pages/map.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
---
layout: page
title: Special Events Map
title: parkrun Explorer Map
permalink: /map/
javascript_libs:
- third-party/leaflet/leaflet-1.3.1.js
- third-party/jquery/jquery-3.6.0.js
- third-party/d3-voronoi/d3-voronoi.js
- third-party/leaflet-canvasicon/leaflet-canvasicon-0.1.4.js
- third-party/leaflet-extramarkers/leaflet-extramarkers-1.0.5.js
- third-party/leaflet-fullscreen/leaflet-fullscreen-1.0.1.js
- third-party/leaflet-markercluster/leaflet-markercluster-1.3.0.js
- leaflet-slidemenu/leaflet-sidemenu.js
- data/geo-REPLACE_WITH_RUNNING_CHALLENGES_COMMIT_HASH.js
- data/special-events-REPLACE_WITH_RUNNING_CHALLENGES_COMMIT_HASH.js
javascript_onload:
- file: map.js
function: draw_map('mapid')
Expand All @@ -24,32 +24,13 @@ css_libs:
- map.css
---

The following map lists the special events over the 2019/20 Christmas/New Year period.

This data was collated on 2019-12-19, by which time all events should have submitted their
intended start times (if they are doing the extra events). Please bear in mind this data may
still change, so please check the appropriate parkrun's webpage for confirmation before making the trip.

Happy festive parkrunning!
The following map replicates the explorer map in the Running Challenges browser extension. At some point the extension will probably stop working, so this is here is a stop-gap. It may also finally provide the map on mobile devices.

<div id="mapid"></div>
<br/>

### Usage Notes

- Go fullscreen to get the best view, and hide the menu if you like.
- 5k parkrun events have circular markers, junior parkrun events have square markers.
- Not all time & event distance (5k/junior) combinations have markers on the map.
- This only considers 5k events
- This map works on mobile devices for when you are out and about.

### Other fantastic maps and tools

- If you are interested in doing the double this New Year's Day, head over to the
[Rikki Prince](https://twitter.com/rikkiprince)'s amazing
[Double Finder Tool](https://tailrun.uk/nyd/2020/) to see which ones
you might be able to do in 2020.
- If you are on the lookout for filling in a spot on your Wilson Index, head over
to Mark Pinney's [Challenge Chaser](http://www.challenge-chaser.com/map).
- And of course, for all things tourism related, check out
[Tim GP](https://twitter.com/timdp)'s absolutely awesome
[Tourist Tool](https://touristtool.mybluemix.net/)!
Loading
Loading