From 83ad9d7c76d91fc87cc3b098f411df6e9da6602b Mon Sep 17 00:00:00 2001 From: the-digital-anarchist Date: Thu, 15 Sep 2022 11:33:18 +0200 Subject: [PATCH 01/15] feat(leaflet map) adds map --- .vscode/settings.json | 3 + content/contributors.md | 2 + data/geojsonContributors.json | 105 ++++++++++++++++++ .../lumbung-theme/layouts/shortcodes/map.html | 82 ++++++++++++++ 4 files changed, 192 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 data/geojsonContributors.json create mode 100644 themes/lumbung-theme/layouts/shortcodes/map.html diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..caecf1a --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "languageTool.enabled": true +} diff --git a/content/contributors.md b/content/contributors.md index 46626b9..84d97d4 100644 --- a/content/contributors.md +++ b/content/contributors.md @@ -5,6 +5,8 @@ draft: false hidden: true --- +{{< map geoJson="data/geojsonContributors.json">}} + ## Lumbung members - **The Question of Funding** - Adele Jarrar diff --git a/data/geojsonContributors.json b/data/geojsonContributors.json new file mode 100644 index 0000000..eda46a2 --- /dev/null +++ b/data/geojsonContributors.json @@ -0,0 +1,105 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-163.84239965043153, -35.395420121207046] + }, + "properties": { + "groupName": "The Question of Funding", + "listOfNames": [ + "Adele Jarrar", + "Amany Khalifa", + "Dena Matter", + "Fayrouz Sharqawi", + "Martin Heller", + "Mohammad Hawajri", + "Mohammad Abu Sal", + "Noor Abed", + "Raed Issa", + "Raoof Alajouri", + "Rayya Badran", + "Siwar Kraitm", + "Yazan Khalili" + ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [44.33431006730271, -50.20912785456733] + }, + "properties": { + "groupName": "The Question of Funding", + "listOfNames": [ + "Adele Jarrar", + "Amany Khalifa", + "Dena Matter", + "Fayrouz Sharqawi", + "Martin Heller", + "Mohammad Hawajri", + "Mohammad Abu Sal", + "Noor Abed", + "Raed Issa", + "Raoof Alajouri", + "Rayya Badran", + "Siwar Kraitm", + "Yazan Khalili" + ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [156.98134366371633, -20.842390202069744] + }, + "properties": { + "groupName": "The Question of Funding", + "listOfNames": [ + "Adele Jarrar", + "Amany Khalifa", + "Dena Matter", + "Fayrouz Sharqawi", + "Martin Heller", + "Mohammad Hawajri", + "Mohammad Abu Sal", + "Noor Abed", + "Raed Issa", + "Raoof Alajouri", + "Rayya Badran", + "Siwar Kraitm", + "Yazan Khalili" + ] + } + }, + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [-174.13057315088798, -25.3268003637054] + }, + "properties": { + "groupName": "The Question of Funding", + "listOfNames": [ + "Adele Jarrar", + "Amany Khalifa", + "Dena Matter", + "Fayrouz Sharqawi", + "Martin Heller", + "Mohammad Hawajri", + "Mohammad Abu Sal", + "Noor Abed", + "Raed Issa", + "Raoof Alajouri", + "Rayya Badran", + "Siwar Kraitm", + "Yazan Khalili" + ] + } + } + ] +} diff --git a/themes/lumbung-theme/layouts/shortcodes/map.html b/themes/lumbung-theme/layouts/shortcodes/map.html new file mode 100644 index 0000000..2bb6c8c --- /dev/null +++ b/themes/lumbung-theme/layouts/shortcodes/map.html @@ -0,0 +1,82 @@ +{{ with .Get "geoJson" }} +{{ $geoJson := . }} +{{ $data := getJSON $geoJson }} +
+ + + + + + +
+ + + + + +
+{{ end }} \ No newline at end of file From 17c39586fc83e68f04b7cff2057f914f55fd50ae Mon Sep 17 00:00:00 2001 From: the-digital-anarchist Date: Thu, 15 Sep 2022 11:47:19 +0200 Subject: [PATCH 02/15] testing deployment --- config.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/config.toml b/config.toml index 826c181..c30b79a 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,3 @@ -baseURL = "https://lumbung.space" languageCode = "en-gb" title = "lumbung.space" theme = "lumbung-theme" From b58a4233e241d91577f3ca4c230420c456fb19f1 Mon Sep 17 00:00:00 2001 From: the-digital-anarchist Date: Thu, 15 Sep 2022 11:51:14 +0200 Subject: [PATCH 03/15] new test --- config.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config.toml b/config.toml index c30b79a..390b7e0 100644 --- a/config.toml +++ b/config.toml @@ -1,3 +1,4 @@ +baseURL = "https://lumbung.space/" languageCode = "en-gb" title = "lumbung.space" theme = "lumbung-theme" From 6128d5d70be23c9f145dcda008258bfaf35c7114 Mon Sep 17 00:00:00 2001 From: the-digital-anarchist Date: Thu, 15 Sep 2022 11:53:40 +0200 Subject: [PATCH 04/15] test deployment vercel --- themes/lumbung-theme/layouts/partials/head.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/lumbung-theme/layouts/partials/head.html b/themes/lumbung-theme/layouts/partials/head.html index 38b375f..791e0da 100644 --- a/themes/lumbung-theme/layouts/partials/head.html +++ b/themes/lumbung-theme/layouts/partials/head.html @@ -14,8 +14,8 @@ {{ template "_internal/opengraph.html" . }} {{ template "_internal/twitter_cards.html" . }} - - + + {{ with .Site.Params.favicon }} From 43be59cf3846eec4e75cca0840b79fb921647e6a Mon Sep 17 00:00:00 2001 From: the-digital-anarchist Date: Thu, 15 Sep 2022 13:29:38 +0200 Subject: [PATCH 05/15] cleanup --- config.toml | 2 +- themes/lumbung-theme/layouts/shortcodes/map.html | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/config.toml b/config.toml index 390b7e0..826c181 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,4 @@ -baseURL = "https://lumbung.space/" +baseURL = "https://lumbung.space" languageCode = "en-gb" title = "lumbung.space" theme = "lumbung-theme" diff --git a/themes/lumbung-theme/layouts/shortcodes/map.html b/themes/lumbung-theme/layouts/shortcodes/map.html index 2bb6c8c..9cf74ff 100644 --- a/themes/lumbung-theme/layouts/shortcodes/map.html +++ b/themes/lumbung-theme/layouts/shortcodes/map.html @@ -53,8 +53,6 @@ } }); - - layer.bindPopup(textOutput.join('')) } From 04fdb8cb2e866a441636424773d8900006a66b35 Mon Sep 17 00:00:00 2001 From: the-digital-anarchist Date: Thu, 15 Sep 2022 13:53:42 +0200 Subject: [PATCH 06/15] cleanup --- themes/lumbung-theme/layouts/partials/head.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/lumbung-theme/layouts/partials/head.html b/themes/lumbung-theme/layouts/partials/head.html index 791e0da..38b375f 100644 --- a/themes/lumbung-theme/layouts/partials/head.html +++ b/themes/lumbung-theme/layouts/partials/head.html @@ -14,8 +14,8 @@ {{ template "_internal/opengraph.html" . }} {{ template "_internal/twitter_cards.html" . }} - - + + {{ with .Site.Params.favicon }} From 70b51ff8da06ef83fa51404fca81f443281e9531 Mon Sep 17 00:00:00 2001 From: the-digital-anarchist Date: Thu, 15 Sep 2022 14:04:59 +0200 Subject: [PATCH 07/15] adds documentation --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/README.md b/README.md index 0721ec1..e9edaa8 100644 --- a/README.md +++ b/README.md @@ -85,3 +85,53 @@ After a `git pull`, you may need to run `pip install git+https://git.autonomic.z ### Deploy a new `feeds_list.txt` Increment the `_v` (e.g. `v1` -> `v2`) in [`compose.yml`](./compose.yml) `configs` to avoid any deployment error. + +#### Adding a leaflet map to a page + +To add a new leaflet map use the shortcode: +``` +{{< map geoJson="data/geojsonContributors.json">}} +``` +This way you can display a map on any page with any data. + +To add data to the map, add a new json file to the `data/` directory and use the [geojson datascructure](https://geojson.org/) in the json file. +Then point the `geoJson="data/newfile.json"` in the shortcode to the new file. + +If you wanna display new tekst in the tooltips just add a new property key/value. + +e.g. + +``` + "properties": { + "a": "new value", + } +``` +One catcha is that Javascipt always output the order of the object in alfabetic order, there is nothing to do about this. + +Key names `groupName` and `listOfNames` are reserved. +This will display it in the way it does now on the map +e.g. +``` +"properties": { + "groupName": "The Question of Funding", + "listOfNames": [ + "Adele Jarrar", + "Amany Khalifa", + ] +} +``` +So just to be clear if you want extra value under it, give the key name a letter that is after the `l` in the alfabet. +e.g. +``` +"properties": { + "groupName": "The Question of Funding", + "listOfNames": [ + "Adele Jarrar", + "Amany Khalifa", + ], + "m": "value under the list" +} +``` + +The new added value will alway be displayed the same and will be in a `

` tag. + From b8e44aa6e28174e361b4c324733f92777a3df715 Mon Sep 17 00:00:00 2001 From: the-digital-anarchist Date: Thu, 15 Sep 2022 14:10:50 +0200 Subject: [PATCH 08/15] minor text correction --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9edaa8..fd2dfc1 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ After a `git pull`, you may need to run `pip install git+https://git.autonomic.z Increment the `_v` (e.g. `v1` -> `v2`) in [`compose.yml`](./compose.yml) `configs` to avoid any deployment error. -#### Adding a leaflet map to a page +### Adding a leaflet map to a page To add a new leaflet map use the shortcode: ``` From 226551a8e831984e6d8330c2ef0ea8f0f851aa1f Mon Sep 17 00:00:00 2001 From: Aadil Ayub Date: Tue, 20 Sep 2022 11:46:22 +0500 Subject: [PATCH 09/15] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd2dfc1..ef06359 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ This way you can display a map on any page with any data. To add data to the map, add a new json file to the `data/` directory and use the [geojson datascructure](https://geojson.org/) in the json file. Then point the `geoJson="data/newfile.json"` in the shortcode to the new file. -If you wanna display new tekst in the tooltips just add a new property key/value. +If you wanna display new test in the tooltips just add a new property key/value. e.g. From 78a37c87b776ce308f92eee10f95fe2658896e8b Mon Sep 17 00:00:00 2001 From: the-digital-anarchist Date: Fri, 23 Sep 2022 14:23:45 +0200 Subject: [PATCH 10/15] adds audio and video to leaflet map popup --- data/geojsonContributors.json | 11 ++++-- .../lumbung-theme/layouts/shortcodes/map.html | 35 +++++++++++++------ 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/data/geojsonContributors.json b/data/geojsonContributors.json index eda46a2..971d5dd 100644 --- a/data/geojsonContributors.json +++ b/data/geojsonContributors.json @@ -23,7 +23,10 @@ "Rayya Badran", "Siwar Kraitm", "Yazan Khalili" - ] + ], + "video": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm", + "iframe": "https://tv.lumbung.space/videos/embed/d5b26273-cb7e-4f5e-9041-5694a504405e?title=0", + "audio": "https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3" } }, { @@ -48,7 +51,8 @@ "Rayya Badran", "Siwar Kraitm", "Yazan Khalili" - ] + ], + "iframe": "https://tv.lumbung.space/videos/embed/d5b26273-cb7e-4f5e-9041-5694a504405e?title=0" } }, { @@ -73,7 +77,8 @@ "Rayya Badran", "Siwar Kraitm", "Yazan Khalili" - ] + ], + "iframe": "https://tv.lumbung.space/videos/embed/d5b26273-cb7e-4f5e-9041-5694a504405e?title=0" } }, { diff --git a/themes/lumbung-theme/layouts/shortcodes/map.html b/themes/lumbung-theme/layouts/shortcodes/map.html index 9cf74ff..eb32332 100644 --- a/themes/lumbung-theme/layouts/shortcodes/map.html +++ b/themes/lumbung-theme/layouts/shortcodes/map.html @@ -38,28 +38,43 @@