markdownPagePathToRoutePath #

把相对源码目录的 Markdown 页面路径,转成它的公开路由路径。

用法 #

TypeScript
import { 
markdownPagePathToRoutePath
} from 'kawapress'
const
route
=
markdownPagePathToRoutePath
('guide/index.md')

参数

pagePathstring

页面相对源码目录的路径,例如 guide/intro.md。

返回值 路由路径,例如 /guide/intro。

完整类型签名
TypeScript
function markdownPagePathToRoutePath(pagePath: string): string

编辑此页

评论