Skip to content

Commit

Permalink
fix: not found page
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Jul 9, 2017
1 parent 4492c3e commit 9af8559
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/core/fetch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,24 @@ export function fetchMixin (proto) {
// Current page is html
this.isHTML = /\.html$/g.test(path)

// Load main content
last.then((text, opt) => {
this._renderMain(text, opt)
const loadSideAndNav = () => {
if (!loadSidebar) return cb()

const fn = result => { this._renderSidebar(result); cb() }

// Load sidebar
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
loadNavbar &&
Expand Down
4 changes: 4 additions & 0 deletions src/core/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ export function renderMixin (proto) {
}

proto._renderMain = function (text, opt = {}) {
if (!text) {
return renderMain.call(this, text)
}

callHook(this, 'beforeEach', text, result => {
let html = this.isHTML ? result : this.compiler.compile(result)
if (opt.updatedAt) {
Expand Down

0 comments on commit 9af8559

Please sign in to comment.