Skip to content

Commit b2b4742

Browse files
committed
fix: docsify-updated is undefined
1 parent a8c73ee commit b2b4742

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/core/fetch/ajax.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export function get (url, hasBar = false) {
4545
const result = cache[url] = {
4646
content: target.response,
4747
opt: {
48-
updatedAt: xhr.getResponseHeader('last-modified')
48+
updatedAt: xhr.getResponseHeader('last-modified') ||
49+
xhr.getResponseHeader('expires')
4950
}
5051
}
5152

src/core/render/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,12 @@ export function renderMixin (proto) {
108108
getAndActive('nav')
109109
}
110110

111-
proto._renderMain = function (text, opt) {
111+
proto._renderMain = function (text, opt = {}) {
112112
callHook(this, 'beforeEach', text, result => {
113113
let html = this.isHTML ? result : markdown(result)
114-
html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated)
114+
if (opt.updatedAt) {
115+
html = formatUpdated(html, opt.updatedAt, this.config.formatUpdated)
116+
}
115117

116118
callHook(this, 'afterEach', html, text => renderMain.call(this, text))
117119
})

0 commit comments

Comments
 (0)