Rework a bunch of scripts into a single website script

This commit is contained in:
Eryn Wells 2024-11-18 14:59:43 -08:00
parent f83c6ebbe5
commit a9f52aad98
12 changed files with 275 additions and 92 deletions

View file

@ -0,0 +1,12 @@
#!/usr/bin/env python3
# Eryn Wells <eryn@erynwells.me>
import re
def slugify(s: str) -> str:
'''Process a string into something suitable to be a page slug.'''
s = s.strip().lower()
s = re.sub(r'\s+', '-', s)
s = re.sub(r'[‘’“”"\'()]', '', s)
return s