diff --git a/folk/to-do/andree.png b/folk/i/andree.png similarity index 100% rename from folk/to-do/andree.png rename to folk/i/andree.png diff --git a/scripts/make-folklist.py b/scripts/make-folklist.py index 1d7db7681..11cf8ce27 100644 --- a/scripts/make-folklist.py +++ b/scripts/make-folklist.py @@ -28,12 +28,25 @@ def troggle_slugify(longname): This function copied instact from troggle/parsers/people/py """ slug = longname.strip().lower().replace(" ","-") + slug = re.sub('\([^\)]*\)','',slug) # remove nickname in brackets + slug = slug.replace('é', 'e') + slug = slug.replace('á', 'a') + slug = slug.replace('ä', 'a') + slug = slug.replace('&', '') # otherwise just remove the & + slug = slug.replace(';', '') # otherwise just remove the ; + slug = re.sub('<[^>]*>','',slug) # remove + if len(slug) > 40: # slugfield is 50 chars slug = slug[:40] if slug in slug_cache: slug_cache[slug] += 1 slug = f"{slug}_{slug_cache[slug]}" slug_cache[slug] = 1 + + # t = longname.find("&") + # s = longname.find(">") + # if t > -1 or s > -1: + # sys.stderr.write(f"{t}-{s} '{longname}' {slug}\n") return slug for r in lines[1:]: @@ -57,20 +70,16 @@ for r in lines[1:]: output += '' if expos_caving == 0: output += '' - # Middle names still not working: MorvenBeranek-Stanley , Sarah Livia Zerbes # Need to manage names e.g. Leif Hornsved (Nickname) => LeifHornsved namevis = name.replace('""', '"').strip('"') # Need to manage e.g.Olaf Kähler # Need to manage e.g. Bal%26aacute%3BzsIzapy - nameurl = namevis.replace(' ', '') - nameurl = nameurl.replace('&', '%26') - nameurl = nameurl.replace(';', '%3B') - nameurl = re.sub('<[^>]*>','',nameurl) - nameurl = re.sub('\([^\)]*\)','',nameurl) # mostly not needed, but is for Wookey + # nameurl = namevis.replace(' ', '') + # nameurl = nameurl.replace('&', '%26') + # nameurl = nameurl.replace(';', '%3B') # new url using slug - nameurl = re.sub('\([^\)]*\)','',name) - nameurl = troggle_slugify(nameurl) + nameurl = troggle_slugify(namevis) namelink= "" + namevis + "" output += namelink #output += name.replace('""', '"')