withBase #
给站点路径加上站点的 base 前缀。外部 URL 和 # 锚点原样返回。
用法 #
TypeScript
import { withBase } from 'kawapress'
const href = withBase('/guide/start', '/docs/')
参数
pathstring
站点路径,例如 /guide/start。
basestring
站点的 base,例如 /docs/。
返回值 加了 base 的路径。
完整类型签名
TypeScript
function withBase(path: string, base: string): string

评论