mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-22 22:59: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 javascript from 'highlight.js/lib/languages/javascript';
|
||||||
import style from 'highlight.js/styles/github-gist.css';
|
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');
|
const {default: CodeStyler} = await import(/* webpackChunkName: "code-styling" */ './../classes/codeStyler');
|
||||||
|
|
||||||
return new CodeStyler({
|
return new CodeStyler({
|
||||||
selector: '.block-code',
|
selector: '.block-code'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,10 @@ router.get('/page/:id', async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
let page = await Pages.get(pageId);
|
let page = await Pages.get(pageId);
|
||||||
|
|
||||||
|
let pageParent = await page.parent;
|
||||||
|
|
||||||
res.render('pages/page', {
|
res.render('pages/page', {
|
||||||
page
|
page, pageParent
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
res.status(404);
|
res.status(404);
|
||||||
|
|
|
@ -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 {{ pageParent.title }}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<time class="page__header-time">
|
<time class="page__header-time">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue