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”file name”
/index.md/indexindex/index
/some/index.mdsomeindexsome/index/some/some
/some.mdsomesomesome/some/some
/index.mdx/indexindex/index
/Index.md/IndexIndex/Index
  • 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 insensitively?
  • do we need option to match against more than slug if there is ambiguity, like index, other/index, some/other/index?

Other thoughts:

  • with alias there can be more than one name / url
    • see also “against more than slug if there is ambiguity”
  • can I implement “did you mean” suggestions?