fix: not found page
This commit is contained in:
parent
4492c3e19f
commit
9af855921e
2 changed files with 15 additions and 4 deletions
|
|
@ -28,17 +28,24 @@ export function fetchMixin (proto) {
|
||||||
// Current page is html
|
// Current page is html
|
||||||
this.isHTML = /\.html$/g.test(path)
|
this.isHTML = /\.html$/g.test(path)
|
||||||
|
|
||||||
// Load main content
|
const loadSideAndNav = () => {
|
||||||
last.then((text, opt) => {
|
|
||||||
this._renderMain(text, opt)
|
|
||||||
if (!loadSidebar) return cb()
|
if (!loadSidebar) return cb()
|
||||||
|
|
||||||
const fn = result => { this._renderSidebar(result); cb() }
|
const fn = result => { this._renderSidebar(result); cb() }
|
||||||
|
|
||||||
// Load sidebar
|
// Load sidebar
|
||||||
loadNested(path, loadSidebar, fn, this, true)
|
loadNested(path, loadSidebar, fn, this, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load main content
|
||||||
|
last.then((text, opt) => {
|
||||||
|
this._renderMain(text, opt)
|
||||||
|
loadSideAndNav()
|
||||||
},
|
},
|
||||||
_ => this._renderMain(null))
|
_ => {
|
||||||
|
this._renderMain(null)
|
||||||
|
loadSideAndNav()
|
||||||
|
})
|
||||||
|
|
||||||
// Load nav
|
// Load nav
|
||||||
loadNavbar &&
|
loadNavbar &&
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,10 @@ export function renderMixin (proto) {
|
||||||
}
|
}
|
||||||
|
|
||||||
proto._renderMain = function (text, opt = {}) {
|
proto._renderMain = function (text, opt = {}) {
|
||||||
|
if (!text) {
|
||||||
|
return renderMain.call(this, text)
|
||||||
|
}
|
||||||
|
|
||||||
callHook(this, 'beforeEach', text, result => {
|
callHook(this, 'beforeEach', text, result => {
|
||||||
let html = this.isHTML ? result : this.compiler.compile(result)
|
let html = this.isHTML ? result : this.compiler.compile(result)
|
||||||
if (opt.updatedAt) {
|
if (opt.updatedAt) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue