fix: docsify-updated is undefined
This commit is contained in:
parent
a8c73ee2b9
commit
b2b474264f
2 changed files with 6 additions and 3 deletions
|
|
@ -45,7 +45,8 @@ export function get (url, hasBar = false) {
|
|||
const result = cache[url] = {
|
||||
content: target.response,
|
||||
opt: {
|
||||
updatedAt: xhr.getResponseHeader('last-modified')
|
||||
updatedAt: xhr.getResponseHeader('last-modified') ||
|
||||
xhr.getResponseHeader('expires')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -108,10 +108,12 @@ export function renderMixin (proto) {
|
|||
getAndActive('nav')
|
||||
}
|
||||
|
||||
proto._renderMain = function (text, opt) {
|
||||
proto._renderMain = function (text, opt = {}) {
|
||||
callHook(this, 'beforeEach', text, result => {
|
||||
let html = this.isHTML ? result : markdown(result)
|
||||
html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated)
|
||||
if (opt.updatedAt) {
|
||||
html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated)
|
||||
}
|
||||
|
||||
callHook(this, 'afterEach', html, text => renderMain.call(this, text))
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue