···11import { slug } from "github-slugger"
22-import type { ElementContent, Element as HastElement } from "hast"
22+import type { Element as HastElement } from "hast"
33// this file must be isomorphic so it can't use node libs (e.g. path)
4455export const QUARTZ = "quartz"
···2525/** Shouldn't be a relative path and shouldn't have `/index` as an ending or a file extension. It _can_ however have a trailing slash to indicate a folder path. */
2626export type SimpleSlug = SlugLike<"simple">
2727export function isSimpleSlug(s: string): s is SimpleSlug {
2828- const validStart = !(s.startsWith(".") || s.startsWith("/"))
2828+ const validStart = !(s.startsWith(".") || (s.length > 1 && s.startsWith("/")))
2929 const validEnding = !(s.endsWith("/index") || s === "index")
3030 return validStart && !_containsForbiddenCharacters(s) && validEnding && !_hasFileExtension(s)
3131}