kebab-cased

written 1 March 2025

kebab-case is the standard for web links, so I did a conversion. Here's the script:


import shutil 
import string
import os
dirs = os.listdir()

EXCEPTIONS = {
    "blogRSS.njk",
    "LMFAOshaco.njk",
}

mapping = dict()
for d in dirs:
    x = d
    if d not in EXCEPTIONS:
        for c in string.ascii_uppercase:
            x = x.replace(c, "-" + c.lower())
    
    mapping[d] = x
for i in mapping.items():
    print(i)

input("continue? (ctrl c to exit)")

for src, dest in mapping.items():
    shutil.move(src, dest)