fix(render): support html file

This commit is contained in:
qingwei.li 2017-02-19 00:10:38 +08:00 • committed by cinwell.li
commit 7b6a2ac404
7 changed files with 35 additions and 18 deletions

View file

@ -23,7 +23,7 @@ export function routeMixin (proto) {
path = getAlias(path, config.alias)
path = getFileName(path)
path = path === '/README.md' ? ('/' + config.homepage || path) : path
path = path === '/README.md' ? (config.homepage || path) : path
path = getPath(base, path)
return path

View file

@ -38,17 +38,17 @@ export const getBasePath = cached(base => {
})
export function getPath (...args) {
const path = args.find(path => /:|(\/{2})/.test(path))
if (path) return path
return cleanPath(args.join('/'))
}
export const isResolvePath = cached(path => {
return /:|(\/{2})/.test(path)
})
export const getRoot = cached(path => {
return /\/$/g.test(path) ? path : path.match(/(\S*\/)[^\/]+$/)[1]
})
export function cleanPath (path) {
export const cleanPath = cached(path => {
return path.replace(/\/+/g, '/')
}
})