mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-15 16:26:07 +10:00
fix: docsify-updated is undefined
This commit is contained in:
@@ -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))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user