diff --git a/stuff/AnyConv.com__points.kml b/stuff/AnyConv.com__points.kml new file mode 100644 index 0000000..ed37d06 --- /dev/null +++ b/stuff/AnyConv.com__points.kml @@ -0,0 +1,86 @@ + + + + + Waypoints + + Testing + + 9.195427,45.480224 + + + + Testing + + 9.211414,45.479559 + + + + Testing + + 9.203267,45.470044 + + + + Testing + + 9.191543,45.475358 + + + + Testing + + 9.208902,45.474596 + + + + Testing + + 9.214803,45.478549 + + + + Testing + + 9.210735,45.468963 + + + + Testing + + 9.194717,45.476398 + + + + Testing + + 9.200197,45.475918 + + + + Testing + + 9.214712,45.479553 + + + + Testing + + 9.208935,45.477010 + + + + Testing + + 9.197640,45.481823 + + + + Testing + + 9.212113,45.475774 + + + + + diff --git a/stuff/gpx.py b/stuff/gpx.py new file mode 100644 index 0000000..39a1439 --- /dev/null +++ b/stuff/gpx.py @@ -0,0 +1,29 @@ +import gpxpy + +coordinates = [ + (45.48022428207604,9.195426779729253), + (45.47955920386783,9.211414017521326), + (45.47004427949249,9.203266840037728), + (45.475357889920666,9.191542629685118), + (45.47459610057904,9.208902213194566), + (45.478548651650364,9.214803404483442), + (45.46896260077224,9.210735083849189), + (45.476397626274775,9.194716709512006), + (45.475918164099824,9.200196924291388), + (45.479553171431604,9.21471213487326), + (45.47701013861511,9.208935252810576), + (45.48182315628131,9.197640483441692), + (45.47577401244318,9.212112575183651) +] + +gpx = gpxpy.gpx.GPX() + +for coord in coordinates: + lat, lon = coord + w = gpxpy.gpx.GPXWaypoint() + w.latitude = lat + w.longitude = lon + w.name = "Testing" + gpx.waypoints.append(w) + +print(gpx.to_xml()) \ No newline at end of file diff --git a/stuff/index.html b/stuff/index.html new file mode 100644 index 0000000..9a7d741 --- /dev/null +++ b/stuff/index.html @@ -0,0 +1,85 @@ + + + + + + + + + NFC Map + + + + + + + + + + +
+ + + diff --git a/stuff/map.css b/stuff/map.css new file mode 100644 index 0000000..8d51734 --- /dev/null +++ b/stuff/map.css @@ -0,0 +1,9 @@ +html, body { + height: 100%; + margin: 0; + padding: 0; +} + +#map { + height: 100%; + width: 100vw; } \ No newline at end of file diff --git a/stuff/points.gpx b/stuff/points.gpx new file mode 100644 index 0000000..42a7212 --- /dev/null +++ b/stuff/points.gpx @@ -0,0 +1,42 @@ + + + + Testing + + + Testing + + + Testing + + + Testing + + + Testing + + + Testing + + + Testing + + + Testing + + + Testing + + + Testing + + + Testing + + + Testing + + + Testing + + \ No newline at end of file diff --git a/random.txt b/stuff/random.txt similarity index 100% rename from random.txt rename to stuff/random.txt diff --git a/web/__pycache__/pelicanconf.cpython-310.pyc b/web/__pycache__/pelicanconf.cpython-310.pyc index 2cbec3c..fc632d5 100644 Binary files a/web/__pycache__/pelicanconf.cpython-310.pyc and b/web/__pycache__/pelicanconf.cpython-310.pyc differ diff --git a/web/content/pages/locate.md b/web/content/pages/locate.md new file mode 100644 index 0000000..59dd776 --- /dev/null +++ b/web/content/pages/locate.md @@ -0,0 +1,3 @@ +Title: Geohash +Save_as: geohash/index.html +Template: locate \ No newline at end of file diff --git a/web/content/tags/ein_hod_01.md b/web/content/tags/ein_hod_01.md index 74fc54b..3c6494b 100644 --- a/web/content/tags/ein_hod_01.md +++ b/web/content/tags/ein_hod_01.md @@ -1,4 +1,4 @@ -Title: Entry 1 +Title: Journal Entry 1 Date: 2023-04-12 Category: Blue Eyed Donkey Location: 32.70124169424201, 34.9805500394171 diff --git a/web/content/tags/ein_hod_02.md b/web/content/tags/ein_hod_02.md new file mode 100644 index 0000000..035f315 --- /dev/null +++ b/web/content/tags/ein_hod_02.md @@ -0,0 +1,6 @@ +Title: Journal Entry 2 +Date: 2023-04-12 +Category: Blue Eyed Donkey +Location: 32.699615286072735, 34.98304356695975 + +I spent the day exploring the town and stumbled upon an old, abandoned house. Inside, I found a collection of paintings that immediately caught my eye. They were unlike anything I had ever seen before, with bold colors and abstract shapes. I later learned that the artist who painted them was an Austrian painter who had worked as a traffic warden in the early days of the country. Her eccentricity was well-known among the locals, and it's said that she inspired Sunday, one of the founders of the town, in his own artistic pursuits. It's a shame that her work has been forgotten and left to decay in this abandoned house. \ No newline at end of file diff --git a/web/content/tags/ein_hod_03.md b/web/content/tags/ein_hod_03.md new file mode 100644 index 0000000..11c5652 --- /dev/null +++ b/web/content/tags/ein_hod_03.md @@ -0,0 +1,6 @@ +Title: Journal Entry 3 +Date: 2023-04-12 +Category: Blue Eyed Donkey +Location: 32.70003059472479, 34.985554114475526 + +As I wandered through the museum today, I stumbled upon a hidden room tucked away in a corner. It was like nothing I'd ever seen before. The air was heavy with the scent of wood and brass, and strange instruments and machines filled the room. Pipes and horns seemed to sprout from the walls like metallic vines, and the organs were unlike any I'd ever laid eyes on, with keyboards sprouting in every direction. As I explored further, I found boxes adorned with mysterious levers and knobs that seemed to emit a cacophony of otherworldly sounds. It was as though I had stumbled into the secret workshop of a mad scientist. \ No newline at end of file diff --git a/web/content/tags/test_01.md b/web/content/tags/test_01.md new file mode 100644 index 0000000..cf6e700 --- /dev/null +++ b/web/content/tags/test_01.md @@ -0,0 +1,6 @@ +Title: Test +Date: 2023-04-12 +Category: Testing +Location: 32.70194460092584, 34.972507850461874 + +As I wandered through the museum today, I stumbled upon a hidden room tucked away in a corner. It was like nothing I'd ever seen before. The air was heavy with the scent of wood and brass, and strange instruments and machines filled the room. Pipes and horns seemed to sprout from the walls like metallic vines, and the organs were unlike any I'd ever laid eyes on, with keyboards sprouting in every direction. As I explored further, I found boxes adorned with mysterious levers and knobs that seemed to emit a cacophony of otherworldly sounds. It was as though I had stumbled into the secret workshop of a mad scientist. \ No newline at end of file diff --git a/web/nfc-theme/static/bluedot.svg b/web/nfc-theme/static/bluedot.svg new file mode 100644 index 0000000..38bf264 --- /dev/null +++ b/web/nfc-theme/static/bluedot.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/web/nfc-theme/static/geo.js b/web/nfc-theme/static/geo.js index 6ccbc3e..bac5889 100644 --- a/web/nfc-theme/static/geo.js +++ b/web/nfc-theme/static/geo.js @@ -4,7 +4,12 @@ const ios = ua.indexOf("ios") > -1; const windows = ua.indexOf("windows") > -1; const linux = ua.indexOf("linux") > -1; const mac = ua.indexOf("macos") > -1; -var hashlink = document.querySelector(".geo a"); -if ( windows || mac || linux ) hashlink.href = "https://maps.google.com/?q=" + hashlink.getAttribute("latlon"); -else if ( android ) hashlink.href = "geo:0,0?q=" + hashlink.getAttribute("latlon"); -else if ( ios ) hashlink.href = "http://maps.apple.com/?ll=" + hashlink.getAttribute("latlon") + "&q=" + hashlink.innerHTML; \ No newline at end of file +var hashlinks = document.querySelectorAll(".geo a"); +var hasharray = [...hashlinks]; +if ( hasharray.length > 0 ) { + hasharray.forEach(hashlink => { + if ( windows || mac || linux ) hashlink.href = "https://maps.google.com/?q=" + hashlink.getAttribute("latlon"); + else if ( android ) hashlink.href = "geo:0,0?q=" + hashlink.getAttribute("latlon"); + else if ( ios ) hashlink.href = "http://maps.apple.com/?ll=" + hashlink.getAttribute("latlon") + "&q=" + hashlink.innerHTML; + }); +} \ No newline at end of file diff --git a/web/nfc-theme/static/local.css b/web/nfc-theme/static/local.css index 81986bf..4d5de2d 100644 --- a/web/nfc-theme/static/local.css +++ b/web/nfc-theme/static/local.css @@ -141,4 +141,32 @@ blockquote { border: 1px solid; margin: 0; padding-left: 1em; +} + +#map { + height: 100%; + width: 100vw; +} + +#map img { + border: none +} + +.info { + padding: 6px 8px; + background: white; + background: rgba(255,255,255,0.8); + box-shadow: 0 0 15px rgba(0,0,0,0.2); + border-radius: 5px; +} + +.info h4 { + font-size: 1.6em; + margin: 0 0 5px; + color: #777; +} + +.info span { + line-height: 18px; + vertical-align: top; } \ No newline at end of file diff --git a/web/nfc-theme/static/map.js b/web/nfc-theme/static/map.js new file mode 100644 index 0000000..aa1bcab --- /dev/null +++ b/web/nfc-theme/static/map.js @@ -0,0 +1,82 @@ +var bluedot = L.icon({ + iconUrl: '/theme/bluedot.svg', + iconSize: [18, 18], + iconAnchor: [9, 9], + popupAnchor: [0, -10] +}); + +var nfctag = L.icon({ + iconUrl: '/theme/nfclogo.svg', + iconSize: [20, 20], + iconAnchor: [10, 10], + popupAnchor: [0, -12] +}); + +const showNfcTags = L.geoJSON(nfcTags, { + pointToLayer(feature, latlng) { return L.marker(latlng, { icon: nfctag });}, + onEachFeature +}); + +const map = L.map('map').fitBounds(showNfcTags.getBounds()); + +const tiles = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + maxZoom: 19, + attribution: '© OpenStreetMap' +}).addTo(map); + +showNfcTags.addTo(map); +map.on('locationfound', onLocationFound); +map.on('locationerror', onLocationError); +map.locate({setView: false, watch: true}); + +function onEachFeature(feature, layer) { + let popupContent = ``; + + if (feature.properties && feature.properties.title) { + popupContent += feature.properties.title; + } + + layer.bindPopup(popupContent); +} + +var locationMarker, locationCircle; +pageload = true; + +function onLocationFound(e) { + if (locationMarker) { + map.removeLayer(locationMarker); + map.removeLayer(locationCircle); + } + const radius = e.accuracy / 2; + if ( pageload ) { + area = showNfcTags.getBounds(); + area.extend(e.latlng); + map.fitBounds(area); + map.zoomOut(1, {animate: false}); + pageload = false; + } + locationMarker = L.marker(e.latlng, {icon: bluedot}).addTo(map) + locationCircle = L.circle(e.latlng, radius).addTo(map); +} + +function onLocationError(e) { + alert(e.message); +} + +var info = L.control({position: 'topright'}); +var download = L.control({position: 'bottomleft'}); + +info.onAdd = function (map) { + this._div = L.DomUtil.create('div', 'info'); // create a div with a class "info" + this._div.innerHTML = '

' + nfcTags["title"] + '

' + ' NFC Tag Locations'; + return this._div; +}; + +download.onAdd = function (map) { + this._div = L.DomUtil.create('div', 'info'); // create a div with a class "info" + this._div.innerHTML = 'Download GPX KML'; + return this._div; +}; + +info.addTo(map); +download.addTo(map); \ No newline at end of file diff --git a/web/nfc-theme/static/nfclogo.svg b/web/nfc-theme/static/nfclogo.svg new file mode 100644 index 0000000..62be6ba --- /dev/null +++ b/web/nfc-theme/static/nfclogo.svg @@ -0,0 +1,31 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/web/nfc-theme/templates/archives.html b/web/nfc-theme/templates/archives.html index 63913c1..8200ec8 100644 --- a/web/nfc-theme/templates/archives.html +++ b/web/nfc-theme/templates/archives.html @@ -1 +1,20 @@ -{% extends "base.html" %} \ No newline at end of file +{% extends "base.html" %} +{% block content %} +
+{% block content_title %} +{% endblock %} + +{% for article in articles %} + +
+
+

+ {{ article.category }}: {{ article.title }} +

+ {{ article.summary }} +
+
+{% endfor %} + +
+{% endblock content %} diff --git a/web/nfc-theme/templates/article.html b/web/nfc-theme/templates/article.html index 53df4ec..3827261 100644 --- a/web/nfc-theme/templates/article.html +++ b/web/nfc-theme/templates/article.html @@ -4,10 +4,8 @@
{{ article.content }} {% if article.metadata.geohash %} - {{ article.metadata.geohash }} + NFC {% endif %}
- - {% endblock %} diff --git a/web/nfc-theme/templates/base.html b/web/nfc-theme/templates/base.html index 31d21d4..0d234a6 100644 --- a/web/nfc-theme/templates/base.html +++ b/web/nfc-theme/templates/base.html @@ -20,4 +20,6 @@ {% endif %} + + diff --git a/web/nfc-theme/templates/category.html b/web/nfc-theme/templates/category.html index f64ed15..01859d7 100644 --- a/web/nfc-theme/templates/category.html +++ b/web/nfc-theme/templates/category.html @@ -1,5 +1,46 @@ -{% extends "index.html" %} -{% block content_title %} -

{{ category }}

-{% endblock %} + + + + + + + + {{ category }} + + + + + + + + + +
+ + + diff --git a/web/nfc-theme/templates/gosquared.html b/web/nfc-theme/templates/gosquared.html deleted file mode 100644 index f47efcf..0000000 --- a/web/nfc-theme/templates/gosquared.html +++ /dev/null @@ -1,14 +0,0 @@ -{% if GOSQUARED_SITENAME %} - -{% endif %} diff --git a/web/nfc-theme/templates/index.html b/web/nfc-theme/templates/index.html index 27e4131..7cda289 100644 --- a/web/nfc-theme/templates/index.html +++ b/web/nfc-theme/templates/index.html @@ -9,7 +9,7 @@

- {{ article.title }} + {{ article.metadata.geohash }}

{{ article.summary }}
@@ -18,4 +18,4 @@ {% include 'pagination.html' %} -{% endblock content %} +{% endblock content %} \ No newline at end of file diff --git a/web/nfc-theme/templates/locate.html b/web/nfc-theme/templates/locate.html new file mode 100644 index 0000000..9757552 --- /dev/null +++ b/web/nfc-theme/templates/locate.html @@ -0,0 +1,127 @@ + + + + + + + + {{ page.name }} + + + + + + + + + +
+ + + diff --git a/web/output/geohash/index.html b/web/output/geohash/index.html new file mode 100644 index 0000000..55d65df --- /dev/null +++ b/web/output/geohash/index.html @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/web/output/index.html b/web/output/index.html index b06f007..3ae4bae 100644 --- a/web/output/index.html +++ b/web/output/index.html @@ -15,4 +15,6 @@ + + \ No newline at end of file diff --git a/web/output/projects/blue-eyed-donkey.gpx b/web/output/projects/blue-eyed-donkey.gpx new file mode 100644 index 0000000..ff53056 --- /dev/null +++ b/web/output/projects/blue-eyed-donkey.gpx @@ -0,0 +1,15 @@ + + + + + + + Journal Entry 1 + + + Journal Entry 2 + + + Journal Entry 3 + + diff --git a/web/output/projects/blue-eyed-donkey.kml b/web/output/projects/blue-eyed-donkey.kml new file mode 100644 index 0000000..142ff79 --- /dev/null +++ b/web/output/projects/blue-eyed-donkey.kml @@ -0,0 +1,26 @@ + + + + + Blue Eyed Donkey + + Journal Entry 1 + + 34.9805500394171,32.70124169424201 + + + + Journal Entry 2 + + 34.98304356695975,32.699615286072735 + + + + Journal Entry 3 + + 34.985554114475526,32.70003059472479 + + + + + diff --git a/web/output/projects/blue-eyed-donkey/index.html b/web/output/projects/blue-eyed-donkey/index.html index e3c5bbf..7826d8a 100644 --- a/web/output/projects/blue-eyed-donkey/index.html +++ b/web/output/projects/blue-eyed-donkey/index.html @@ -1,27 +1,66 @@ - - - + + + + + Blue Eyed Donkey + + + + + + + + + +
+ \ No newline at end of file diff --git a/web/output/projects/index.html b/web/output/projects/index.html index f4733cc..5dd8c41 100644 --- a/web/output/projects/index.html +++ b/web/output/projects/index.html @@ -10,7 +10,10 @@ + + \ No newline at end of file diff --git a/web/output/projects/testing.gpx b/web/output/projects/testing.gpx new file mode 100644 index 0000000..4b983db --- /dev/null +++ b/web/output/projects/testing.gpx @@ -0,0 +1,9 @@ + + + + + + + Test + + diff --git a/web/output/projects/testing.kml b/web/output/projects/testing.kml new file mode 100644 index 0000000..fa0eec1 --- /dev/null +++ b/web/output/projects/testing.kml @@ -0,0 +1,14 @@ + + + + + Testing + + Test + + 34.972507850461874,32.70194460092584 + + + + + diff --git a/web/output/projects/testing/index.html b/web/output/projects/testing/index.html new file mode 100644 index 0000000..165d00e --- /dev/null +++ b/web/output/projects/testing/index.html @@ -0,0 +1,44 @@ + + + + + + + + Testing + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/web/output/svbf5c4nwkr/index.html b/web/output/svbf5c4nwkr/index.html new file mode 100644 index 0000000..6f9c35a --- /dev/null +++ b/web/output/svbf5c4nwkr/index.html @@ -0,0 +1,21 @@ + + + + + + + + + + +
+
+

As I wandered through the museum today, I stumbled upon a hidden room tucked away in a corner. It was like nothing I'd ever seen before. The air was heavy with the scent of wood and brass, and strange instruments and machines filled the room. Pipes and horns seemed to sprout from the walls like metallic vines, and the organs were unlike any I'd ever laid eyes on, with keyboards sprouting in every direction. As I explored further, I found boxes adorned with mysterious levers and knobs that seemed to emit a cacophony of otherworldly sounds. It was as though I had stumbled into the secret workshop of a mad scientist.

+ NFC +
+
+ + + + + \ No newline at end of file diff --git a/web/output/svbfh0cc5fp/index.html b/web/output/svbfh0cc5fp/index.html new file mode 100644 index 0000000..ffbd6da --- /dev/null +++ b/web/output/svbfh0cc5fp/index.html @@ -0,0 +1,21 @@ + + + + + + + + + + +
+
+

I spent the day exploring the town and stumbled upon an old, abandoned house. Inside, I found a collection of paintings that immediately caught my eye. They were unlike anything I had ever seen before, with bold colors and abstract shapes. I later learned that the artist who painted them was an Austrian painter who had worked as a traffic warden in the early days of the country. Her eccentricity was well-known among the locals, and it's said that she inspired Sunday, one of the founders of the town, in his own artistic pursuits. It's a shame that her work has been forgotten and left to decay in this abandoned house.

+ NFC +
+
+ + + + + \ No newline at end of file diff --git a/web/output/svbfh0geqrx/index.html b/web/output/svbfh0geqrx/index.html new file mode 100644 index 0000000..35ad58e --- /dev/null +++ b/web/output/svbfh0geqrx/index.html @@ -0,0 +1,21 @@ + + + + + + + + + + +
+
+

As I wandered through the museum today, I stumbled upon a hidden room tucked away in a corner. It was like nothing I'd ever seen before. The air was heavy with the scent of wood and brass, and strange instruments and machines filled the room. Pipes and horns seemed to sprout from the walls like metallic vines, and the organs were unlike any I'd ever laid eyes on, with keyboards sprouting in every direction. As I explored further, I found boxes adorned with mysterious levers and knobs that seemed to emit a cacophony of otherworldly sounds. It was as though I had stumbled into the secret workshop of a mad scientist.

+ NFC +
+
+ + + + + \ No newline at end of file diff --git a/web/output/svbfh1049ck/index.html b/web/output/svbfh1049ck/index.html index 68b5398..40e5a90 100644 --- a/web/output/svbfh1049ck/index.html +++ b/web/output/svbfh1049ck/index.html @@ -11,11 +11,11 @@

I noticed a peculiar sensation in the air as soon as I arrived in town. It was as if an electric charge was coursing through the air beneath the pastoral tranquillity, making me nervous. I looked around, but there was no one to be found. The faint odor of decay lingered around me, mingled with the sweet fragrance of incense. The mix made me feel uneasy, like if I'd stepped into a strange, surreal dream.

- svbfh1049ck + NFC
- - + + \ No newline at end of file diff --git a/web/output/tags/index.html b/web/output/tags/index.html index 2f96f5a..8b7910e 100644 --- a/web/output/tags/index.html +++ b/web/output/tags/index.html @@ -14,7 +14,34 @@

- Entry 1 + svbfh1049ck +

+ +
+
+ +
+
+

+ svbfh0cc5fp +

+ +
+
+ +
+
+

+ svbfh0geqrx +

+ +
+
+ +
+
+

+ svbf5c4nwkr

@@ -23,4 +50,6 @@ + + \ No newline at end of file diff --git a/web/output/tags/list.html b/web/output/tags/list.html new file mode 100644 index 0000000..c01a857 --- /dev/null +++ b/web/output/tags/list.html @@ -0,0 +1,55 @@ + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + \ No newline at end of file diff --git a/web/output/theme/DavidLibre-Regular.ttf b/web/output/theme/DavidLibre-Regular.ttf deleted file mode 100644 index cf23de8..0000000 Binary files a/web/output/theme/DavidLibre-Regular.ttf and /dev/null differ diff --git a/web/output/theme/bluedot.svg b/web/output/theme/bluedot.svg new file mode 100644 index 0000000..38bf264 --- /dev/null +++ b/web/output/theme/bluedot.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/web/output/theme/geo.js b/web/output/theme/geo.js index 6ccbc3e..bac5889 100644 --- a/web/output/theme/geo.js +++ b/web/output/theme/geo.js @@ -4,7 +4,12 @@ const ios = ua.indexOf("ios") > -1; const windows = ua.indexOf("windows") > -1; const linux = ua.indexOf("linux") > -1; const mac = ua.indexOf("macos") > -1; -var hashlink = document.querySelector(".geo a"); -if ( windows || mac || linux ) hashlink.href = "https://maps.google.com/?q=" + hashlink.getAttribute("latlon"); -else if ( android ) hashlink.href = "geo:0,0?q=" + hashlink.getAttribute("latlon"); -else if ( ios ) hashlink.href = "http://maps.apple.com/?ll=" + hashlink.getAttribute("latlon") + "&q=" + hashlink.innerHTML; \ No newline at end of file +var hashlinks = document.querySelectorAll(".geo a"); +var hasharray = [...hashlinks]; +if ( hasharray.length > 0 ) { + hasharray.forEach(hashlink => { + if ( windows || mac || linux ) hashlink.href = "https://maps.google.com/?q=" + hashlink.getAttribute("latlon"); + else if ( android ) hashlink.href = "geo:0,0?q=" + hashlink.getAttribute("latlon"); + else if ( ios ) hashlink.href = "http://maps.apple.com/?ll=" + hashlink.getAttribute("latlon") + "&q=" + hashlink.innerHTML; + }); +} \ No newline at end of file diff --git a/web/output/theme/local.css b/web/output/theme/local.css index 81986bf..4d5de2d 100644 --- a/web/output/theme/local.css +++ b/web/output/theme/local.css @@ -141,4 +141,32 @@ blockquote { border: 1px solid; margin: 0; padding-left: 1em; +} + +#map { + height: 100%; + width: 100vw; +} + +#map img { + border: none +} + +.info { + padding: 6px 8px; + background: white; + background: rgba(255,255,255,0.8); + box-shadow: 0 0 15px rgba(0,0,0,0.2); + border-radius: 5px; +} + +.info h4 { + font-size: 1.6em; + margin: 0 0 5px; + color: #777; +} + +.info span { + line-height: 18px; + vertical-align: top; } \ No newline at end of file diff --git a/web/output/theme/map.js b/web/output/theme/map.js new file mode 100644 index 0000000..aa1bcab --- /dev/null +++ b/web/output/theme/map.js @@ -0,0 +1,82 @@ +var bluedot = L.icon({ + iconUrl: '/theme/bluedot.svg', + iconSize: [18, 18], + iconAnchor: [9, 9], + popupAnchor: [0, -10] +}); + +var nfctag = L.icon({ + iconUrl: '/theme/nfclogo.svg', + iconSize: [20, 20], + iconAnchor: [10, 10], + popupAnchor: [0, -12] +}); + +const showNfcTags = L.geoJSON(nfcTags, { + pointToLayer(feature, latlng) { return L.marker(latlng, { icon: nfctag });}, + onEachFeature +}); + +const map = L.map('map').fitBounds(showNfcTags.getBounds()); + +const tiles = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + maxZoom: 19, + attribution: '© OpenStreetMap' +}).addTo(map); + +showNfcTags.addTo(map); +map.on('locationfound', onLocationFound); +map.on('locationerror', onLocationError); +map.locate({setView: false, watch: true}); + +function onEachFeature(feature, layer) { + let popupContent = ``; + + if (feature.properties && feature.properties.title) { + popupContent += feature.properties.title; + } + + layer.bindPopup(popupContent); +} + +var locationMarker, locationCircle; +pageload = true; + +function onLocationFound(e) { + if (locationMarker) { + map.removeLayer(locationMarker); + map.removeLayer(locationCircle); + } + const radius = e.accuracy / 2; + if ( pageload ) { + area = showNfcTags.getBounds(); + area.extend(e.latlng); + map.fitBounds(area); + map.zoomOut(1, {animate: false}); + pageload = false; + } + locationMarker = L.marker(e.latlng, {icon: bluedot}).addTo(map) + locationCircle = L.circle(e.latlng, radius).addTo(map); +} + +function onLocationError(e) { + alert(e.message); +} + +var info = L.control({position: 'topright'}); +var download = L.control({position: 'bottomleft'}); + +info.onAdd = function (map) { + this._div = L.DomUtil.create('div', 'info'); // create a div with a class "info" + this._div.innerHTML = '

' + nfcTags["title"] + '

' + ' NFC Tag Locations'; + return this._div; +}; + +download.onAdd = function (map) { + this._div = L.DomUtil.create('div', 'info'); // create a div with a class "info" + this._div.innerHTML = 'Download GPX KML'; + return this._div; +}; + +info.addTo(map); +download.addTo(map); \ No newline at end of file diff --git a/web/output/theme/nfclogo.svg b/web/output/theme/nfclogo.svg new file mode 100644 index 0000000..62be6ba --- /dev/null +++ b/web/output/theme/nfclogo.svg @@ -0,0 +1,31 @@ + + + + +Created by potrace 1.15, written by Peter Selinger 2001-2017 + + + + + diff --git a/web/pelicanconf.py b/web/pelicanconf.py index d362fd5..b82e6a0 100644 --- a/web/pelicanconf.py +++ b/web/pelicanconf.py @@ -34,10 +34,11 @@ MARKDOWN = { } } +ARTICLE_ORDER_BY = 'category' ARTICLE_URL = "{slug}" ARTICLE_SAVE_AS = "{slug}/index.html" INDEX_SAVE_AS = "tags/index.html" -ARCHIVES_SAVE_AS = '' +ARCHIVES_SAVE_AS = 'tags/list.html' AUTHOR_SAVE_AS = '' AUTHORS_SAVE_AS = '' TAGS_SAVE_AS = '' @@ -56,4 +57,4 @@ CATEGORY_SAVE_AS = 'projects/{slug}/index.html' DELETE_OUTPUT_DIRECTORY = True -PLUGINS = ['geohash'] \ No newline at end of file +PLUGINS = ['geohash', 'geodata'] \ No newline at end of file diff --git a/web/plugins/geodata/__init__.py b/web/plugins/geodata/__init__.py new file mode 100644 index 0000000..bb0a31d --- /dev/null +++ b/web/plugins/geodata/__init__.py @@ -0,0 +1 @@ +from .geodata import * \ No newline at end of file diff --git a/web/plugins/geodata/__pycache__/__init__.cpython-310.pyc b/web/plugins/geodata/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000..51dbda6 Binary files /dev/null and b/web/plugins/geodata/__pycache__/__init__.cpython-310.pyc differ diff --git a/web/plugins/geodata/__pycache__/geodata.cpython-310.pyc b/web/plugins/geodata/__pycache__/geodata.cpython-310.pyc new file mode 100644 index 0000000..ad93af2 Binary files /dev/null and b/web/plugins/geodata/__pycache__/geodata.cpython-310.pyc differ diff --git a/web/plugins/geodata/__pycache__/map.cpython-310.pyc b/web/plugins/geodata/__pycache__/map.cpython-310.pyc new file mode 100644 index 0000000..84ac92a Binary files /dev/null and b/web/plugins/geodata/__pycache__/map.cpython-310.pyc differ diff --git a/web/plugins/geodata/geodata.py b/web/plugins/geodata/geodata.py new file mode 100644 index 0000000..1200486 --- /dev/null +++ b/web/plugins/geodata/geodata.py @@ -0,0 +1,73 @@ +from pelican import signals +from xml.dom import minidom + +collection = {} +gpx_root = ''' +''' +kml_root = ''' +''' + +def make_files(void): + makeGPX() + makeKML() + +def makeKML(): + if len(collection) > 0: + for category in collection: + root = minidom.parseString(kml_root) + folder = root.createElement('name') + foldername = root.createTextNode( collection[category]["name"] ) + folder.appendChild( foldername ) + root.childNodes[0].childNodes[0].childNodes[0].appendChild( folder ) + for place in collection[category]["points"]: + placemark = root.createElement('Placemark') + name = root.createElement('name') + title = root.createTextNode( place['name'] ) + name.appendChild( title ) + placemark.appendChild( name ) + point = root.createElement('Point') + coordinates = root.createElement('coordinates') + lat, lon = place['coordinates'].replace(' ', '').split(',') + latlon = root.createTextNode( lon + ',' + lat) + coordinates.appendChild( latlon ) + point.appendChild( coordinates ) + placemark.appendChild( point ) + root.childNodes[0].childNodes[0].childNodes[0].appendChild( placemark ) + with open('output/projects/' + category + '.kml', 'w') as xml_file: + root.writexml(xml_file, indent="", addindent=" ", newl='\n') + +def makeGPX(): + if len(collection) > 0: + for category in collection: + root = minidom.parseString(kml_root) + for place in collection[category]["points"]: + lat, lon = place['coordinates'].replace(' ', '').split(',') + wpt = root.createElement('wpt') + wpt.setAttribute('lat', lat) + wpt.setAttribute('lon', lon) + name = root.createElement('name') + title = root.createTextNode( place['name'] ) + name.appendChild( title ) + wpt.appendChild( name ) + root.childNodes[0].appendChild( wpt ) + with open('output/projects/' + category + '.gpx', 'w') as xml_file: + root.writexml(xml_file, indent="", addindent=" ", newl='\n') + +def geodata(generator): + for category, articles in generator.categories: + locations = [] + for article in articles: + if "location" in article.metadata: + locations.append({ + "name": article.title, + "coordinates": article.metadata["location"] + }) + collection.update({ + category.slug : { + "name" : category.name, + "points" : locations + }}) + +def register(): + signals.article_generator_finalized.connect(geodata) + signals.finalized.connect(make_files) \ No newline at end of file diff --git a/web/plugins/geohash/__pycache__/geohash.cpython-310.pyc b/web/plugins/geohash/__pycache__/geohash.cpython-310.pyc index f212e42..e594a1a 100644 Binary files a/web/plugins/geohash/__pycache__/geohash.cpython-310.pyc and b/web/plugins/geohash/__pycache__/geohash.cpython-310.pyc differ diff --git a/web/plugins/geohash/geohash.py b/web/plugins/geohash/geohash.py index fa8589d..00793a7 100644 --- a/web/plugins/geohash/geohash.py +++ b/web/plugins/geohash/geohash.py @@ -5,7 +5,8 @@ def generate_geohash(generator): for article in generator.articles: if "location" in article.metadata: lat, lon = [float(i) for i in article.metadata['location'].replace(' ', '').split(',')] - article.metadata['latlon'] = article.metadata['location'].replace(' ', '') + article.metadata['lat'] = lat + article.metadata['lon'] = lon article.metadata['geohash'] = gh.encode(lat, lon, 11) article.slug = gh.encode(lat, lon, 11)