Add a few characters to the list of ones to strip out of strings when slugifying a title
This commit is contained in:
parent
f47c41a80d
commit
d87438bf6a
1 changed files with 4 additions and 1 deletions
|
@ -19,7 +19,10 @@ from typing import Optional
|
||||||
PHOTOS_CONTENT_DIR = 'content/photos'
|
PHOTOS_CONTENT_DIR = 'content/photos'
|
||||||
|
|
||||||
def slugify(s):
|
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):
|
def parse_args(argv, *a, **kw):
|
||||||
parser = argparse.ArgumentParser(*a, **kw)
|
parser = argparse.ArgumentParser(*a, **kw)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue