feat: TOC, scroll to header, page UI improvements

This commit is contained in:
Nicolas Giard
2018-11-17 23:03:58 -05:00
parent e067fe3abd
commit 3abc254685
15 changed files with 1054 additions and 785 deletions

View File

@@ -108,6 +108,7 @@ module.exports = class Page extends Model {
publishStartDate: 'string',
render: 'string',
title: 'string',
toc: 'string',
updatedAt: 'string'
})
}
@@ -125,9 +126,10 @@ module.exports = class Page extends Model {
isPublished: opts.isPublished,
localeCode: opts.locale,
path: opts.path,
publishEndDate: opts.publishEndDate,
publishStartDate: opts.publishStartDate,
title: opts.title
publishEndDate: opts.publishEndDate || '',
publishStartDate: opts.publishStartDate || '',
title: opts.title,
toc: '[]'
})
const page = await WIKI.models.pages.getPageFromDb({
path: opts.path,
@@ -154,8 +156,8 @@ module.exports = class Page extends Model {
content: opts.content,
description: opts.description,
isPublished: opts.isPublished,
publishEndDate: opts.publishEndDate,
publishStartDate: opts.publishStartDate,
publishEndDate: opts.publishEndDate || '',
publishStartDate: opts.publishStartDate || '',
title: opts.title
}).where('id', ogPage.id)
const page = await WIKI.models.pages.getPageFromDb({
@@ -243,6 +245,7 @@ module.exports = class Page extends Model {
publishStartDate: page.publishStartDate,
render: page.render,
title: page.title,
toc: page.toc,
updatedAt: page.updatedAt
}))
}