Skip to content

Slug

How to form slug for root pages?

Root pages can be index.md, index.mdx (or readme.md, readme.mdx in GitHub).

pathoption 1option 2option 3url-path
/index.md/indexindex/
/some/index.mdsomeindexsome/index/some/
/some.mdsomesomesome/some/
/index.mdx/indexindex/
/Index.md/IndexIndex/
  • slug generation is customizable, so if somebody needs any specific behaviour they can implement it
  • option 1 is the current default behaviour
  • I think slug should be case sensitive
  • Only path gauranteed to be unique. Slugs and urls can repeat - maybe create a function to check if there are duplicates SELECT count() FROM documents GROUP BY slug HAVING count() > 1
  • do we need option to match slug case intensively?
  • do we need option to match against more than slug if there is ambiguity, like index, other/index, some/other/index?