Skip to content

Instantly share code, notes, and snippets.

@capjamesg
Last active October 18, 2021 12:55
slugs = {}
slug = "xyz"
if slugs.get(slug):
slugs[slug] += 1
slug = slug + "-" + str(slugs[slug])
else:
slugs[slug] = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment