Files
medusa-store/www/packages/docs-utils/src/get-file-slug.ts
Shahed Nasser 65007c49f6 docs: support generating sidebar items with tags (#10672)
* 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
2024-12-19 18:24:36 +02:00

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
}
}