1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-18 20:59:42 +02:00
codex.docs/src/backend/views/components/sidebar.twig
Umang G. Patel 698c09c489
Add search to sidebar (#215)
* remove package json

* twig file modified

* search bar style added

* the background content added

* add the switching b/w the shortcut logo

* shortcut for search added

* add the arrowup and arrowdown short cut

* sidebar search added

* keyup and keydown replace with input

* the sidebar search selected added

* unusal things

* the enter evenlister added with search refactring

* comments added

* the scroll added if element is not visble

* metakey added

* event listner using shortcut added

* the integration for input box completed

* nodemon config updated

* replace the shortcuts with event listener

* bugfix: up height of header added

* feat:integrate sidebar toggle with search shortcut

* syntax improved

* event listener updated

* border adjusted

* search adjusted

* sidebar search navigation adjusted

* new search module added

* new module integrated

* boxshadow added as border

* sidebar search class added

* sidebar search=>filter

* comments added

* filter for section added

* the expand feature added during navigation

* remove the space

* header height variable added

* shortcut logic updated

* enum for direction added

* common search function added

* expand every match

* updated styles

* updated styles

* margin remove in mobile view with bold removed

* clean css added

Co-authored-by: Peter Savchenko <specc.dev@gmail.com>
2022-10-13 08:30:23 +05:30

62 lines
2.2 KiB
Twig

<div data-module="sidebar" class="docs-sidebar">
<div class="docs-sidebar__toggler">
{{ svg('menu') }} Table of contents
</div>
<aside class="docs-sidebar__content docs-sidebar__content--invisible">
<span class="docs-sidebar__search-wrapper">
<input class="docs-sidebar__search" type="text" placeholder="Search" />
</span>
{% for firstLevelPage in menu %}
<section class="docs-sidebar__section" data-id="{{firstLevelPage._id}}">
<a class="docs-sidebar__section-title-wrapper"
href="{{firstLevelPage.uri ? '/' ~ firstLevelPage.uri : '/page/' ~ firstLevelPage._id }}"
>
<div class="docs-sidebar__section-title {{page is defined and page._id == firstLevelPage._id ? 'docs-sidebar__section-title--active' : ''}}">
<span>
{{ firstLevelPage.title | striptags }}
</span>
{% if firstLevelPage.children is not empty %}
<button class="docs-sidebar__section-toggler">
{{ svg('arrow-up') }}
</button>
{% endif %}
</div>
</a>
{% if firstLevelPage.children is not empty %}
<ul class="docs-sidebar__section-list">
{% for child in firstLevelPage.children %}
<li>
<a
class="docs-sidebar__section-list-item-wrapper"
href="{{ child.uri ? '/' ~ child.uri : '/page/' ~ child._id }}">
<div class="docs-sidebar__section-list-item {{page is defined and page._id == child._id ? 'docs-sidebar__section-list-item--active' : ''}}">
<span>{{ child.title | striptags }}</span>
</div>
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</section>
{% endfor %}
<div class="docs-sidebar__logo">
<a class="docs-sidebar__logo-wrapper" href="https://github.com/codex-team/codex.docs">
<div class="docs-sidebar__logo-image">
{{ svg('aside-logo') }}
</div>
<p class="docs-sidebar__logo-caption">
Powered by CodeX Docs
</p>
</a>
</div>
</aside>
<div class="docs-sidebar__slider">
{{ svg('arrow-left') }}
</div>
</div>