feat: add logo option, #264 (#541)

This commit is contained in:
cinwell.li 2018-06-19 08:19:21 +08:00 • committed by GitHub
commit ee72dd05e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 192 additions and 142 deletions

View file

@ -32,7 +32,9 @@ function formatUpdated(html, updated, fn) {
updated =
typeof fn === 'function' ?
fn(updated) :
typeof fn === 'string' ? tinydate(fn)(new Date(updated)) : updated
typeof fn === 'string' ?
tinydate(fn)(new Date(updated)) :
updated
return html.replace(/{docsify-updated}/g, updated)
}
@ -229,6 +231,10 @@ export function initRender(vm) {
html += tpl.cover()
}
if (config.logo) {
config.logo = getPath(vm.router.getBasePath(), config.logo)
}
html += tpl.main(config)
// Render main app
vm._renderTo(el, html, true)