Add a few characters to the list of ones to strip out of strings when slugifying a title

This commit is contained in:
Eryn Wells 2024-11-07 08:58:21 -08:00
parent f47c41a80d
commit d87438bf6a

View file

@ -19,7 +19,10 @@ from typing import Optional
PHOTOS_CONTENT_DIR = 'content/photos'
def slugify(s):
return re.sub(r'[‘’“”]', '', re.sub(r'\s+', '-', s.strip().lower()))
s = s.strip().lower()
s = re.sub(r'\s+', '-', s)
s = re.sub(r'[‘’“”"\'()]', '', s)
return s
def parse_args(argv, *a, **kw):
parser = argparse.ArgumentParser(*a, **kw)