Browse Source

Fix for Search index not updated during create

pull/33/head
NGPixel 7 years ago
parent
commit
3300d42866
2 changed files with 5 additions and 3 deletions
  1. 4
      libs/entries.js
  2. 4
      views/pages/view.pug

4
libs/entries.js

@ -321,7 +321,9 @@ module.exports = {
return self.exists(entryPath).then((docExists) => {
if (!docExists) {
return self.makePersistent(entryPath, contents).then(() => {
return self.updateCache(entryPath)
return self.updateCache(entryPath).then(entry => {
return search.add(entry)
})
})
} else {
return Promise.reject(new Error('Entry already exists!'))

4
views/pages/view.pug

@ -61,9 +61,9 @@ block content
aside.stickyscroll(data-margin-top=40)
.sidebar-label
i.icon-th-list
span Contents
span Page Contents
ul.sidebar-menu
li: a(href='#root', title='Start') Start
li: a(href='#root', title='Top of Page') Top
+tocMenu(pageData.tree)
.column

Loading…
Cancel
Save