refactor: extract getSlugFromFile()

This commit is contained in:
Oliver Davies 2022-10-16 11:13:09 +01:00
parent ee4f48abcd
commit 1ed365b129
5 changed files with 13 additions and 9 deletions

5
website/src/utils.ts Normal file
View file

@ -0,0 +1,5 @@
export function getSlugFromFile(file: string): string {
const parts = file.replace('.md', '').split('/')
return parts[parts.length - 1]
}