1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-28 01:29:42 +02:00

chore(ui): a bunch of style updates (#235)

* chore(styles): typography updating started

* page styles updated

* page header nav fix, inline code style fix, table, navigator

* use arrow-right icon instead of "»" in bread crumbs

* a bunch of updates

* make content and write page styles more consistent

* rollback layout change

* upd color text second

* upd sidebar logo text color

* resovle someone's ts errors

* remove duplicated variables
This commit is contained in:
Peter Savchenko 2022-09-06 22:58:50 +03:00 committed by GitHub
parent 05f8f0d9e1
commit 237db3e472
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 349 additions and 1174 deletions

View file

@ -1,10 +1,10 @@
import express, { Request, Response } from 'express';
import Aliases from '../controllers/aliases';
import Pages from '../controllers/pages';
import Alias from '../models/alias';
import verifyToken from './middlewares/token';
import PagesFlatArray from '../models/pagesFlatArray';
import HttpException from '../exceptions/httpException';
import Aliases from '../controllers/aliases.js';
import Pages from '../controllers/pages.js';
import Alias from '../models/alias.js';
import verifyToken from './middlewares/token.js';
import PagesFlatArray from '../models/pagesFlatArray.js';
import HttpException from '../exceptions/httpException.js';
const router = express.Router();
@ -48,7 +48,7 @@ router.get('*', verifyToken, async (req: Request, res: Response) => {
}
}
} catch (err) {
if (err instanceof HttpException && err.status === 404) {
if (err instanceof HttpException && (err as HttpException).status === 404) {
res.status(404).render('error', {
message: 'Page not found',
status: 404,
@ -62,4 +62,4 @@ router.get('*', verifyToken, async (req: Request, res: Response) => {
}
});
export default router;
export default router;

View file

@ -3,19 +3,22 @@
{% block body %}
<article class="page" data-module="page">
<header class="page__header">
<a href="/" class="page__header-nav">
Documentation
</a>
{% if page._parent %}
<a class="page__header-nav"
{% if pageParent.uri %}
href="/{{ pageParent.uri }}"
{% else %}
href="/page/{{ pageParent._id }}"
{% endif %}>
{{ pageParent.title }}
<div class="page__header-nav">
<a href="/" class="page__header-nav-item">
Documentation
</a>
{% endif %}
{{ svg('arrow-right') }}
{% if page._parent %}
<a class="page__header-nav-item"
{% if pageParent.uri %}
href="/{{ pageParent.uri }}"
{% else %}
href="/page/{{ pageParent._id }}"
{% endif %}>
{{ pageParent.title }}
</a>
{% endif %}
</div>
<time class="page__header-time">
Last edit {{ (page.body.time / 1000) | date("M d Y") }}
</time>
@ -34,7 +37,9 @@
{# Skip first header, because it is already showed as a Title #}
{% if not (loop.first and block.type == 'header') %}
{% if block.type in ['paragraph', 'header', 'image', 'code', 'list', 'delimiter', 'table', 'warning', 'checklist', 'linkTool', 'raw', 'embed'] %}
{% include './blocks/' ~ block.type ~ '.twig' with block.data %}
<div class="page__content-block">
{% include './blocks/' ~ block.type ~ '.twig' with block.data %}
</div>
{% endif %}
{% endif %}
{% endfor %}