markdownFileToRoutePath #

Public route of a Markdown file, after rewrites.

Usage #

TypeScript
import { 
markdownFileToRoutePath
} from 'kawapress/generator'
const
route
=
markdownFileToRoutePath
(
'/site/guide/a.md', '/site', )

Parameters

filestring

Absolute path of the Markdown file.

sourceRootstring

Absolute source folder, the resolved srcDir.

rewritesoptionalPageRewrites

The rewrites of the site config.

Returns The route path, for example /a/intro.

Full type signature
TypeScript
function markdownFileToRoutePath(file: string, sourceRoot: string, rewrites?: PageRewrites): string

Edit this page

Comments