mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-08 23:15:28 +02:00
right aside added
This commit is contained in:
parent
71344fe33b
commit
b598e0679b
5 changed files with 50 additions and 7 deletions
34
src/backend/views/components/rightAside.twig
Normal file
34
src/backend/views/components/rightAside.twig
Normal file
|
@ -0,0 +1,34 @@
|
|||
<div class="docs-aside-toggler" onclick="document.querySelector('.docs-aside').classList.toggle('docs-aside--toggled')">
|
||||
{{ svg('menu') }}
|
||||
Table of contents
|
||||
</div>
|
||||
<div class="docs-aside">
|
||||
<div class="docs-aside__section-wrapper">
|
||||
{% for firstLevelPage in menu %}
|
||||
<section class="docs-aside__section">
|
||||
<a {% if page is defined and page._id == firstLevelPage._id%} class="docs-aside__section-title docs-aside__current" {% else %} class="docs-aside__section-title" {% endif %} {% if firstLevelPage.uri %} href="/{{ firstLevelPage.uri }}" {% else %} href="/page/{{ firstLevelPage._id }}" {% endif %}>
|
||||
{{ firstLevelPage.title | striptags }}
|
||||
</a>
|
||||
{% if firstLevelPage.children is not empty %}
|
||||
<ul class="docs-aside__section-list">
|
||||
{% for child in firstLevelPage.children %}
|
||||
<li>
|
||||
<a {% if page is defined and page._id == child._id %} class="docs-aside__current" {% endif %} {% if child.uri %} href="/{{ child.uri }}" {% else %} href="/page/{{ child._id }}" {% endif %}>
|
||||
{{ child.title | striptags }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<a class="docs-aside__logo-wrapper" href="https://github.com/codex-team/codex.docs">
|
||||
<div class="logo">
|
||||
{{ svg('aside-logo') }}
|
||||
</div>
|
||||
<div class="caption">
|
||||
<span>Powered by CodeX Docs</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
|
@ -17,14 +17,17 @@
|
|||
<body>
|
||||
{% include "components/header.twig" with res.locals.isAuthorized %}
|
||||
<div class="docs">
|
||||
<aside class="docs__aside">
|
||||
{% include "components/aside.twig" %}
|
||||
<aside class="docs__left-aside">
|
||||
{% include "components/leftAside.twig" %}
|
||||
</aside>
|
||||
<div class="docs__content">
|
||||
<div class="docs__content-inner">
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
<aside class="docs__right-aside">
|
||||
{% include "components/rightAside.twig" %}
|
||||
</aside>
|
||||
</div>
|
||||
<script src="/dist/main.bundle.js"></script>
|
||||
{% if config.yandexMetrikaId is not empty %}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
font-size: 18px;
|
||||
flex-wrap: wrap;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
z-index: 2;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
.docs {
|
||||
display: flex;
|
||||
@media (--mobile) {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
&__aside {
|
||||
&__left-aside {
|
||||
width: var(--layout-width-aside);
|
||||
padding: 0px 22px;
|
||||
border-right: solid 1px var(--color-line-gray);
|
||||
|
@ -24,8 +23,6 @@
|
|||
}
|
||||
|
||||
&__content {
|
||||
flex-grow: 2;
|
||||
word-wrap: break-word;
|
||||
margin-top: var(--layout-height-header);
|
||||
|
||||
@media (--mobile) {
|
||||
|
@ -39,7 +36,15 @@
|
|||
}
|
||||
}
|
||||
|
||||
&__aside,
|
||||
&__right-aside {
|
||||
padding: 0px 22px;
|
||||
position: fixed;
|
||||
top: var(--layout-height-header);
|
||||
right: 0;
|
||||
}
|
||||
|
||||
&__left-aside,
|
||||
&__right-aside,
|
||||
&__content {
|
||||
padding-top: var(--layout-padding-vertical);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue