fixes, cleanup
This commit is contained in:
parent
041b2608d5
commit
a8c4913437
61 changed files with 54 additions and 2648 deletions
Binary file not shown.
Binary file not shown.
|
|
@ -1,6 +1,8 @@
|
|||
from pelican import signals
|
||||
import geohash_tools as gh
|
||||
|
||||
hashes = []
|
||||
|
||||
def generate_geohash(generator):
|
||||
for article in generator.articles:
|
||||
if "location" in article.metadata:
|
||||
|
|
@ -8,7 +10,9 @@ def generate_geohash(generator):
|
|||
article.metadata['lat'] = lat
|
||||
article.metadata['lon'] = lon
|
||||
article.metadata['geohash'] = gh.encode(lat, lon, 11)
|
||||
article.slug = gh.encode(lat, lon, 11)
|
||||
if article.metadata['geohash'] not in hashes:
|
||||
article.slug = gh.encode(lat, lon, 11)
|
||||
hashes.append(article.metadata['geohash'])
|
||||
|
||||
def register():
|
||||
signals.article_generator_finalized.connect(generate_geohash)
|
||||
Loading…
Add table
Add a link
Reference in a new issue