From 3300d4286665dcc196a6592efccfdf3b66d0a688 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Fri, 24 Feb 2017 17:02:54 -0500 Subject: [PATCH] Fix for Search index not updated during create --- libs/entries.js | 4 +++- views/pages/view.pug | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/entries.js b/libs/entries.js index 4f13e1f3..f2df24b4 100644 --- a/libs/entries.js +++ b/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!')) diff --git a/views/pages/view.pug b/views/pages/view.pug index 013d9db0..c9782462 100644 --- a/views/pages/view.pug +++ b/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