* docs: support generating sidebar items with tags * small fix * fix dependencies * test * test fix * test fix * test fix * test fix * another fix * revert change * fix for resources
13 lines
295 B
TypeScript
13 lines
295 B
TypeScript
import { getFrontMatter } from "./get-front-matter.js"
|
|
|
|
export async function getFileSlug(
|
|
filePath: string
|
|
): Promise<string | undefined> {
|
|
const fileFrontmatter = await getFrontMatter(filePath)
|
|
|
|
if (fileFrontmatter.slug) {
|
|
// add to slugs array
|
|
return fileFrontmatter.slug
|
|
}
|
|
}
|