This commit is contained in:
NN Solex 2023-05-01 21:58:23 +03:00
parent 33d02a4845
commit 20c0224bc8
53 changed files with 1329 additions and 60 deletions

View file

@ -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)