1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-10 16:05:32 +02:00
show parent page
This commit is contained in:
Куштанов Руслан Камилевич 2018-12-07 23:47:47 +03:00
parent 262c1614ed
commit ba88799183
2 changed files with 5 additions and 2 deletions

View file

@ -43,8 +43,11 @@ router.get('/page/:id', async (req, res, next) => {
try { try {
let page = await Pages.get(pageId); let page = await Pages.get(pageId);
let parentTitle = (await page.parent).title;
console.log(parentTitle);
res.render('pages/page', { res.render('pages/page', {
page page, parentTitle
}); });
} catch (error) { } catch (error) {
res.status(404); res.status(404);

View file

@ -8,7 +8,7 @@
</a> </a>
{% if page._parent %} {% if page._parent %}
<a href="/page/{{ page._parent }}" class="page__header-nav"> <a href="/page/{{ page._parent }}" class="page__header-nav">
Parent {{ page._parent }} Parent {{ parentTitle }}
</a> </a>
{% endif %} {% endif %}
<time class="page__header-time"> <time class="page__header-time">