Function: urlPathToMarkdownPath() ​

Source: 1.3.4 · 91d5f3968e6a

ts
function urlPathToMarkdownPath(urlPath): object;

Defined in: packages/valaxy/shared/utils/uri.ts:82

Map a route/URL path (e.g. '', '/', '/index', '/posts/hello/') to a collision-free raw Markdown href and relative file path.

  • '' / '/' (pages/index.md) -> /index.md (index.md)
  • '/index' (pages/index/index.md) -> /index/index.md (index/index.md)
  • '/index/index' -> /index/index/index.md (index/index/index.md)
  • Other routes keep ${normalized}.md.

Parameters ​

urlPath ​

string

Returns ​

object

href ​

ts
href: string;

relativeFile ​

ts
relativeFile: string;