mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-19 13:19:42 +02:00
Show parent page title (#14)
* Fix show parent page * Update pages.js * fix * merge
This commit is contained in:
parent
262c1614ed
commit
9966131100
7 changed files with 1671 additions and 12878 deletions
12071
package-lock.json
generated
12071
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,4 +1,4 @@
|
|||
import hljs from "highlight.js/lib/highlight";
|
||||
import hljs from 'highlight.js/lib/highlight';
|
||||
import javascript from 'highlight.js/lib/languages/javascript';
|
||||
import style from 'highlight.js/styles/github-gist.css';
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ export default class Writing {
|
|||
const {default: CodeStyler} = await import(/* webpackChunkName: "code-styling" */ './../classes/codeStyler');
|
||||
|
||||
return new CodeStyler({
|
||||
selector: '.block-code',
|
||||
selector: '.block-code'
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ export default class Writing {
|
|||
|
||||
moduleEl.appendChild(this.nodes.editorWrapper);
|
||||
|
||||
if (settings.page){
|
||||
if (settings.page) {
|
||||
this.page = settings.page;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,8 +43,10 @@ router.get('/page/:id', async (req, res, next) => {
|
|||
try {
|
||||
let page = await Pages.get(pageId);
|
||||
|
||||
let pageParent = await page.parent;
|
||||
|
||||
res.render('pages/page', {
|
||||
page
|
||||
page, pageParent
|
||||
});
|
||||
} catch (error) {
|
||||
res.status(404);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</a>
|
||||
{% if page._parent %}
|
||||
<a href="/page/{{ page._parent }}" class="page__header-nav">
|
||||
Parent {{ page._parent }}
|
||||
Parent {{ pageParent.title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
<time class="page__header-time">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue