mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-09 15:35:25 +02:00
Added uri property to Page model
This commit is contained in:
parent
9966131100
commit
2364fd2ea2
6 changed files with 41 additions and 2134 deletions
2
public/dist/code-styling.bundle.js
vendored
2
public/dist/code-styling.bundle.js
vendored
File diff suppressed because one or more lines are too long
2161
public/dist/editor.bundle.js
vendored
2161
public/dist/editor.bundle.js
vendored
File diff suppressed because one or more lines are too long
4
public/dist/main.bundle.js
vendored
4
public/dist/main.bundle.js
vendored
File diff suppressed because one or more lines are too long
2
public/dist/main.css
vendored
2
public/dist/main.css
vendored
File diff suppressed because one or more lines are too long
|
@ -4,6 +4,7 @@ const {pages: db} = require('../utils/database/index');
|
||||||
* @typedef {Object} PageData
|
* @typedef {Object} PageData
|
||||||
* @property {string} _id - page id
|
* @property {string} _id - page id
|
||||||
* @property {string} title - page title
|
* @property {string} title - page title
|
||||||
|
* @property {string} uri - page uri
|
||||||
* @property {*} body - page body
|
* @property {*} body - page body
|
||||||
* @property {string} parent - id of parent page
|
* @property {string} parent - id of parent page
|
||||||
*
|
*
|
||||||
|
@ -15,6 +16,7 @@ const {pages: db} = require('../utils/database/index');
|
||||||
*
|
*
|
||||||
* @property {string} _id - page id
|
* @property {string} _id - page id
|
||||||
* @property {string} title - page title
|
* @property {string} title - page title
|
||||||
|
* @property {string} uri - page uri
|
||||||
* @property {*} body - page body
|
* @property {*} body - page body
|
||||||
* @property {string} _parent - id of parent page
|
* @property {string} _parent - id of parent page
|
||||||
*/
|
*/
|
||||||
|
@ -69,6 +71,7 @@ class Page {
|
||||||
|
|
||||||
this.body = body || this.body;
|
this.body = body || this.body;
|
||||||
this.title = this.extractTitleFromBody();
|
this.title = this.extractTitleFromBody();
|
||||||
|
this.uri = this._id;
|
||||||
this._parent = parent || this._parent;
|
this._parent = parent || this._parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +84,7 @@ class Page {
|
||||||
return {
|
return {
|
||||||
_id: this._id,
|
_id: this._id,
|
||||||
title: this.title,
|
title: this.title,
|
||||||
|
uri: this.uri,
|
||||||
body: this.body,
|
body: this.body,
|
||||||
parent: this._parent
|
parent: this._parent
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div class="docs-aside">
|
<div class="docs-aside">
|
||||||
{% for firstLevelPage in menu %}
|
{% for firstLevelPage in menu %}
|
||||||
<section class="docs-aside__section">
|
<section class="docs-aside__section">
|
||||||
<a class="docs-aside__section-title" href="/page/{{ firstLevelPage._id }}">
|
<a class="docs-aside__section-title" href="/page/{{ firstLevelPage.uri }}">
|
||||||
{{ firstLevelPage.title }}
|
{{ firstLevelPage.title }}
|
||||||
</a>
|
</a>
|
||||||
{% if firstLevelPage.children is not empty %}
|
{% if firstLevelPage.children is not empty %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue